DUPLICATE OF How can I merge PDF files (or PS if not possible) such that every file will begin in a odd page?
I have a serie of documents, each one with an unpredictable number of pages.
Say :
- a.pdf (1 page : A1)
- b.pdf (3 pages : B1, B2, B3)
- c.pdf (4 pages : C1, C2, C3, C4)
I want to merge these input files into one out.pdf, that I'll print double-side. Every first page of the input files must be on a front (right) page.
This means the expected result would be
|A1
--|B1
B2|B3
--|C1
C2|C3
C4|
with "--" being a blank page.
Currently, I'm using pdftk cat.
There seem to be a solution through heavy scripting, using :
# Get number of pages
pdftk x.pdf dump_data | grep "NumberOfPages"
# If the number of pages is odd, add a blank page to x.pdf
# Loop
# Cat the whole
I was wondering if there might be a more simple an elegant solution ?
For example, is it possible to add page-breaks at the begining of each file ?
Thanks in advance