我正在尝试编写一个程序,它将一个 .pdf 文件作为输入,并在 UNIX 命令行中将每个页面分隔成它们自己的 .pdf 文件。我已经尝试过 SplitPdf,但由于某种原因,我不断收到错误。
更新:我已经尝试过 pdftk,但它的性能很差,而且对 pdf 文件的大小有限制。
最佳答案
使用pdftk .
burst
命令就是您所追求的。
手册页部分:http://www.pdflabs.com/docs/pdftk-man-page/#dest-op-burst
burst
Splits a single, input PDF document into individual pages. Also creates a report named
doc_data.txt
which 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.pdf
to 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
关于pdf - 在 UNIX 中以编程方式将 pdf 页面拆分为它们自己的 pdf,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4621947/