合并拆分的PDF后大小增加 [英] Size increases after merging split PDF

查看:359
本文介绍了合并拆分的PDF后大小增加的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用PDF在我的应用程序中进行渲染,对于页面级的各种其他信息(为不同的o/p格式创建swf,xml等),页面级拆分已完成并得到处理.

I am using PDF to be rendered in my application, for various other information of page level (creating swf, xml etc for different o/p format) page level spliting is done and processed.

环境是Linux(Fedora 8).

Environment is Linux (Fedora 8).

使用分割的PDF重新创建最终的PDF,但是一些PDF的尺寸却急剧增加,其中大字体使用相似的字体.页数.

Final PDF is recreated using the split PDF but there is drastic increase in size for a few PDF where similar font is used over a large no. of pages.

使用iText和PDFTK输出不令人满意... 它只是添加了拆分的PDF,最终输出的大小与单个PDF合并在一起的大小相同.

Using iText and PDFTK output is not satisfactory... It simply adds the split PDF and final output is same size of individual PDF combined together.

我认为优化和/或共享资源重复是我在这里所缺少的...

I think optimization and/or shared resources duplication is what I am missing here...

推荐答案

PdfTk使用了强大的旧版本(且不再受支持)的iText.串联PDF时,它使用PdfCopy类.您应该使用iText和PdfSmartCopy的最新版本. PdfSmartCopy存储添加到新文档中的所有对象的哈希.这使iText可以重用已经存在的对象.

PdfTk uses a mighty old (and no longer supported) version of iText. When concatenating PDFs, it uses the PdfCopy class. You should use a recent version of iText and PdfSmartCopy. PdfSmartCopy stores hashes of all the objects that are added to the new document. This allows iText to reuse objects that already exist.

有关更多信息,请阅读我写的有关iText的书的第6章: http://www .manning.com/lowagie2/samplechapter6.pdf (搜索PdfSmartCopy)

For more info, read chapter 6 of the book I wrote about iText: http://www.manning.com/lowagie2/samplechapter6.pdf (search for PdfSmartCopy)

这篇关于合并拆分的PDF后大小增加的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆