I am trying to write a program that takes as input a .pdf file and separates each page into their own .pdf files in UNIX command line. I have tried SplitPdf but for some reason I keep getting errors.
update: I have already tried pdftk but it has poor performance and a limitation on the size of the pdf file.
Use pdftk.
The burst command is what you are after.
Man page section: http://www.pdflabs.com/docs/pdftk-man-page/#dest-op-burst
burstSplits a single, input PDF document into individual pages. Also creates a report named
doc_data.txtwhich is the same as the output fromdump_data. If the output section is omitted, then PDF pages arenamed:pg_%04d.pdf, e.g.:pg_0001.pdf,pg_0002.pdf, etc. To name these pages yourself, supply a printf-styled format string in the output section. For example, if you want pages named:page_01.pdf,page_02.pdf, etc.,pass outputpage_%02d.pdfto pdftk.Encryption can be applied to the output by appending output options such as owner_pw, e.g.: pdftk in.pdf burst owner_pw foopass
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With