How to concatenate multiple pdf as one, each input pdf starting on an even page?

不问归期 提交于 2019-12-10 15:48:43

问题


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


回答1:


This can be done with pdfjam (which uses TeX; see TeX.SE); the pdfpages package it uses has an option openright which can probably automatically achieve what you want.



来源:https://stackoverflow.com/questions/18082188/how-to-concatenate-multiple-pdf-as-one-each-input-pdf-starting-on-an-even-page

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