Insert a blank page between each existing page in a PDF document

Is there any easy scripting way to do so? I thought of using pdftk but I don't know exactly if it's the easiest way to do. I'm running Windows 7. Thanks so far!

180k 48 48 gold badges 345 345 silver badges 509 509 bronze badges asked Oct 17, 2012 at 20:06 10.1k 22 22 gold badges 84 84 silver badges 143 143 bronze badges Have you seen this: unix.stackexchange.com/questions/15992/…? Commented Oct 17, 2012 at 20:19 nope but now i have. this only inserts one blank page doesn't it? Commented Oct 17, 2012 at 20:32

see also How do I create a blank PDF from the command line?, for example convert xc:none -page A4 blank.pdf with imagemagick

Commented Aug 13 at 18:46

8 Answers 8

Had also this idea for reviewing paper. Here is the full script.

#!/bin/bash if [ $# -ne 1 ] then echo "Usage example: ./bashscript src.pdf" exit $E_BADARGS else NUM=$(pdftk $1 dump_data | grep 'NumberOfPages' | awk '') COMMSTR='' for i in $(seq 1 $NUM); do COMMSTR="$COMMSTR A$i B1 " done $(echo "" | ps2pdf -sPAPERSIZE=a4 - pageblanche.pdf) $(pdftk A=$1 B=pageblanche.pdf cat $COMMSTR output 'mod_'$1) (pdfnup 'mod_'$1 --nup 2x1 --landscape --outfile 'print_'$1) $(rm pageblanche.pdf && rm 'mod_'$1) fi #for f in *.pdf; do ./bashscript.sh $f; done 2> /dev/null 
answered Oct 30, 2014 at 7:51 655 7 7 silver badges 16 16 bronze badges

this is really great. one can also change the 2x1 and --landscape (to --no-landscape ) to produce annotations pages for lecture slides, as an example. Further, I had to install pdfpages via tlmgr install pdfpages for it to work.

Commented May 24, 2018 at 3:57

Just an update for more up-to-date systems: pdfnup is no longer a wrapper in the pdfjam package. Using the above script as-is threw an error for me here. In this case replace pdfnup with pdfjam .

Commented Aug 27, 2020 at 5:53

the only hard part about doing it with pdftk is typing in everything. For posterity (like if someone has a small number of pages and wants to do it this way) Here's how to do it with pdftk (using 3 pages, as an example).

  1. install pdftk http://www.pdflabs.com/docs/install-pdftk/
pdftk A=notblank.pdf B=blank.pdf cat A1-1 B1-1 A2-2 B1-1 A3-3 output combined.pdf 

If you wanted to have a blank page at the end of every 3 pages it would be like this:

pdftk A=notblank.pdf B=blank.pdf cat A1-3 B1-1 A4-6 B1-1 A7-9 output combined.pdf 

If you happened to want a blank page at the end just add another B1-1. Also, you need a blank PDF to work with, and of course this works with non blank pages, and you can mess around with the numbers and use more than 2 pdfs.

answered Nov 16, 2012 at 8:14 user1828796 user1828796 121 1 1 silver badge 4 4 bronze badges blank.pdf? So there is no option to make a white page? Commented Oct 8, 2016 at 15:35

Okay I did it myself using PHP and FPDI/FPDF:

setSourceFile($file); // Alle Seiten nacheinander importieren for($i = 1; $i importPage($i); // , '/MediaBox' // Vorhandene Seite $out->addPage($format); $out->useTemplate($tpl); if($i < $pagecount) < // Leere Seite anfügen (nur nicht am Ende) $out->addPage($format); > > $out->Output($fileout); > 

all files in the subdirectory 'infiles' will get blank Pages inserted and saved to 'outfiles' with the same filename!

answered Oct 18, 2012 at 9:40 10.1k 22 22 gold badges 84 84 silver badges 143 143 bronze badges

i'm just using pdftk, but i guess u can use the shuffle option. if you have notblank.pdf with n pages (n is a little big), create a file blank.pdf with 1 blank page (size could be controlled with PhotoShop or PowerPoint), then the batch file (say n=10)

@echo off setlocal enabledelayedexpansion set "str=" for /l %%n in (1,1,10) do (set "str=!str! A" ) pdftk A=blank.pdf cat %str% output blank10.pdf pdftk A=notblank.pdf B=blank10.pdf shuffle A B output blanknot.pdf 

basically does the job. it first use the 1-page blank.pdf to create a 10-page blank10.pdf, then shuffle with the original notblank.pdf

p.s. i found that using the multistamp command gives rise to a simpler solution. say we now have the original n-page notblank.pdf and a 1-page blank.pdf (make sure that the background is indeed WHITE instead of transparent), then the following commands will suffice

pdftk notblank.pdf multistamp blank.pdf output stamped.pdf pdftk A=notblank.pdf B=stamped.pdf shuffle A B output zebra.pdf 

there's also a blank page at the end of the output file zebra.pdf, which is easy to get rid of by

pdftk A=zebra.pdf cat A1-r2 output zebra1.pdf 

then the last blank page is removed. the output file is roughly twice larger in size, though.

i'm new to pdftk and this is my first post. pls correct me if i'm doing anything stupid.