有没有办法从 C# 将 System.Drawing.Graphics 写入 PDF?
我有一大堆 2D 图形,用于屏幕上的渲染控件和打印,这是非常自定义的图形,任何第三方报告工具或现成的控件都无法完成。
该程序可以生成打印内容的 PDF 文件,但当我编写它时,我作了作弊,只是将 Graphics
对象打印到内存图像中,然后将其嵌入到 PDF 页面中。
由于用户通过电子邮件发送文档,因此发现文档太大。
我已经开始使用 iText 从头开始编写 PDF,但是有没有办法将 System.Drawing.Graphics 内容直接获取到 PDF 中? iText 的工作方式和 Graphics 的工作方式完全不同。
I have a whole bunch of 2D graphics that is being used for both rendering controls on screen and used to print, it's pretty custom graphics that couldn't be done by any 3rd party reporting tools or off the shelf controls.
The program can generate PDF files of the printed content but when I wrote it I cheated and just print the Graphics
object to an in memory image and then embed that into the PDF page.
Since the users are emailing the documents they're finding they are too large.
I've started writing the PDF from scratch using iText, however is there a way to get System.Drawing.Graphics
content directly into PDF? The way iText works and Graphics works is completely different.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
发布评论
评论(4)
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
试试这个库 http://www.pdfsharp.com/PDFsharp/
编辑:以上库已移至http://www.pdfsharp.net/
try this library http://www.pdfsharp.com/PDFsharp/
Edit: Above library has been moved to http://www.pdfsharp.net/