Split a PDF in two

自作多情 提交于 2019-11-28 16:57:11

问题


How do you easily split a large PDF into two (or more) separate PDFs?

Say we have foo-bar.pdf, section foo is from page 1-12 and section bar is from page 13 till the end. I want foo-bar.pdf split into foo.pdf and bar.pdf.


回答1:


You can use pdftk, it's a handy tool for manipulating PDF documents.

sudo apt-get --yes install pdftk
pdftk foo-bar.pdf cat 1-12 output foo.pdf
pdftk foo-bar.pdf cat 13-end output bar.pdf

You can use this method to split a PDF in N ways, or to remove pages.

For example, to remove page 13:

pdftk in.pdf cat 1-12 14-end output out.pdf

Or use it to rotate pages and many other things, see man pdftk.

Installation is also possible by downloading a binary (Windows, OS X, Linux) or using Homebrew.




回答2:


This can be done with cpdf:

cpdf in.pdf 1-12 -o out.pdf

cpdf in.pdf 13-end -o out.pdf

Or, to split into 12-page-sized chunks:

cpdf in.pdf -split -chunk 12 -o out%%%.pdf

Disclosure: I am the author of cpdf.




回答3:


As my distribution doesn't package cpdf neither pdftk, I had to search for another solution and found the easiest one - in order to split PDFs, one can simply "print" page ranges from them, selecting PDF as an output (instead of a printer). This is for sure available in GNOME by default, but I am pretty sure that it is available in other DEs too.



来源:https://stackoverflow.com/questions/17776582/split-a-pdf-in-two

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