How to split PDF using PDFTK

PDFTK can be used to easily split out pages of a PDF file into separate PDF files at the shell. It is available for both Linux and Windows.

To install PDFTK, please follow the instructions here.

To split a PDF file into multiple PDF files, one per page of the original PDF file, invoke:

$ pdftk foobar.pdf burst output foobar-%d.pdf

If foobar.pdf is a 2 page PDF, this splits it into foobar-1.pdf and foobar-2.pdf.

If you split often, it would be much nicer to invoke the above simply as:

$ splitpdf foobar

To be able to do that on Windows, you can turn the above invocation into a batch file:

REM splitpdf.bat
pdftk %1.pdf burst output %1-%%d.pdf

The %1 is the first input argument to the batch file invocation. And %% is the way to escape %, which is a special character in a batch file.

Reference: Beamer + Ipe + views

One thought on “How to split PDF using PDFTK

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.