ABCPDF 执行 doc.AddImageUrl 时更改图像压缩

发布于 2024-09-15 05:25:54 字数 147 浏览 1 评论 0原文

使用 ABCPDF,当前生成 1mb 文件的 pdf。 当我们在 acrobat pro 中更改 pdf 并简单地更改图像质量时,大小会降至 100K。

我已经查看了 ABCPDF 的文档,但是我找不到在保存文档之前降低图像质量的简单示例,从而获得较小的 pdf。

Using ABCPDF, currently generating pdf's with 1mb files.
When we alter the pdf in acrobat pro, and simply change the image quality this drops the size to 100K.

I have looked at the documentation for ABCPDF however I cannot find a simple example of dropping the image quality prior to saving the document, hence getting a smaller pdf.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

埋情葬爱 2024-09-22 05:25:54

看起来很简单:

doc.HtmlOptions.ImageQuality = 33;

Appears simple :

doc.HtmlOptions.ImageQuality = 33;

箹锭⒈辈孓 2024-09-22 05:25:54

在不检查用于创建 PDF 的代码的情况下,我强烈建议您再次查看它,以确保您对文档使用 Flatten 方法。

http://www.websupergoo.com/helppdf7net/default.html

AbcPdf 库将对象添加到页面,每个对象通常表示为一个单独的层。当您执行Flatten方法时,文档上的所有图层都将被删除并替换为压缩表示。

C# 代码片段示例:

for (int i = 1; i <= yourPdfDocument.PageCount; i++) {
  yourPdfDocument.PageNumber = i;
  yourPdfDocument.Flatten();
}

Without reviewing the code you used to create the PDF, I would strongly suggest taking a second look at it ensure you are using the Flatten method for your document.

http://www.websupergoo.com/helppdf7net/default.html

The AbcPdf library adds objects to a page with each typically represented as an individual layer. When you execute the Flatten method all layers on the document will be removed and replaced by compressed respresentation.

Example c# code snippet:

for (int i = 1; i <= yourPdfDocument.PageCount; i++) {
  yourPdfDocument.PageNumber = i;
  yourPdfDocument.Flatten();
}
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文