pdftk split pdf with multiple pages

若如初见. 提交于 2019-11-29 16:35:59

问题


with php i have to split a single pdf file with multiple pages inside it to a lot of PDF file with one page per file. I use pdftk and works fine, but every pdf created for every page is very large size. My original PDF is 7MB (with 70pages inside), the sum of every file created by splitting with pdftk is over 70MB.

Someone know if there is a property to set for pdftk to have small file output?

thank you


回答1:


You could always specify the compress option - for example:

pdftk input.pdf burst output output_%02d.pdf compress

Note that pdftk just copies the content of your PDF files from the inputs into the outputs, and can't do very much to optimize away bloat. So if your input PDFs are large/complicated, your output PDFs will be also. Also note that any fonts embedded in the document may end up being duplicated in each output document, taking up more space.




回答2:


You may use pdftk and try

pdftk source.pdf cat 1-100 output try1.pdf
pdftk source.pdf cat 101-end output try2.pdf



回答3:


When splitting PDF files, it's sometimes hard to avoid information which is only required by some pages being included in each output file.

cpdf tries hard to avoid this -- you can try it and see what happens. You might find it's no better than pdftk on your file, but it should be.

Disclosure: I am the author of cpdf.




回答4:


Had a similar problem. But does not apply 1:1 to the question. Anyways somebody might find it useful:

  1. I had a very big pdf file - original.pdf - of more than 240MB. It was almost impossible to use it. I printed it out with evince as a pdf and removed any scaling in the printer setup. This generated a file - new.pdf - of around 102MB! Obviously all the embedded fonts, bookmarks and so on were removed.
  2. To get the bookmarks back I used cpdf to extract the bookmarks from the original pdf document and applied it to the new one. The resulting document - result.pdf - is easy to navigate and very quick in any pdf viewer.

Reference: cpdf to extract and apply bookmarks: http://www.coherentpdf.com/cpdfmanual/node38.html

cpdf -list-bookmarks original.pdf > booksmarks.txt
cpdf -add-bookmarks booksmarks.txt new.pdf -o result.pdf


来源:https://stackoverflow.com/questions/19991144/pdftk-split-pdf-with-multiple-pages

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!