缩小 PDF 的技巧(使用 ABCPdf7)
我正在从 HTML 生成 PDF(使用 ABCPdf 和 C#),并且文件大小合理。不过,我对任何人关于使 PDF 尽可能小的建议感兴趣。
有人有什么好主意吗?
呈现的 HTML 非常基本,只是一个名称和日期等表格 - 不必太漂亮。
干杯!
-Ev
I'm generating PDFs from HTML (using ABCPdf and C#) and the files are coming out a reasonable size. However, I'm interested in any tips anyone has for making the PDFs as small as possible.
Anyone for any great ideas?
The HTML being rendered is really basic, just a table of names and dates etc - doesn't have to be too pretty.
Cheers!
-Ev
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果布局如此简单,那么尝试放弃 HTML 生成,直接使用 C# 工具和库编写 PDF。读取 HTML 形式的数据应该不成问题。
If layout is so simple, then try to relinquish the generation from HTML and write PDF directly with C# tools and libs. Read the data form HTML shouldn't be a problem.
如果您还没有使用 Flatten 方法,这将为您返还一些不一定需要的空间。请注意,当 PDF 非常简单时,您不会从中获得太多回报,但值得一试。
查看文档以获取更多信息,这确实意味着,如果您想稍后打开并修改同一个 PDF,它会简化和压缩文件中的数据,因此遍历它并进行更改会更加复杂。
If you aren't already using the Flatten method, that will give you back some of the space that is not necessarily required. Be warned that you don't get much back from this when the PDF is very simple, but it's worth a try.
Check the documentation for more info, it does mean that if you want to open and modify the same PDF later that it simplifies and compresses the data in the file and so it's more complicated to walk over it and make changes.