Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

pdftk split pdf with multiple pages but total size grew

Tags:

php

split

pdf

pdftk

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?

like image 420
Simone M Avatar asked Nov 15 '13 00:11

Simone M


People also ask

How do I split a large PDF file for free?

Click the Select a file button above or drag and drop a PDF into the drop zone to split PDF pages. Sign in to Acrobat. Select divider lines to set up the page ranges for each split PDF file you need. Click Save.


3 Answers

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.

like image 160
pobrelkey Avatar answered Sep 25 '22 09:09

pobrelkey


You may use pdftk and try

pdftk source.pdf cat 1-100 output try1.pdf pdftk source.pdf cat 101-end output try2.pdf 
like image 39
Kungfu_panda Avatar answered Sep 21 '22 09:09

Kungfu_panda


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.

like image 36
johnwhitington Avatar answered Sep 25 '22 09:09

johnwhitington