I have a PDF file that needs a blank page inserted into it every so often. The pattern is unpredictable, so I need a command that will allow me to fit one in wherever necessary.
How can i do this?
ghostscriptpdfpdftk
I have a PDF file that needs a blank page inserted into it every so often. The pattern is unpredictable, so I need a command that will allow me to fit one in wherever necessary.
How can i do this?
Best Answer
From http://blog.chewearn.com/2008/12/18/rearrange-pdf-pages-with-pdftk/
Hope you like this script, just save it as
pdfInsertBlankPageAt.sh
, add execute permissions, and run../pdfInsertBlankPageAt 5 src.pdf res.pdf
cat A1 B1 A2-end
means that the output file will contain the first page of document A (src.pdf
) followed by the first page of document B (blank.pdf
) followed by the rest (pages 2 to end) of document B. This operation is called concatenation, Linuxcat
is very often used to display text, but it is interesting when used with more than one argument.To create
blank.pdf
, see How do I create a blank PDF from the command line?