LoginSignup
1
1

More than 5 years have passed since last update.

複数の PDF ファイルを、n-up の条件を変えて結合

Posted at

目的

もともとは、1つ目のPDFファイルを1-up で、2つ目のPDFファイルを4-upで出力すること。
応用すると、いろいろなパターンに対応できる。
対象環境はLinux。

やり方

  1. Linuxに予めpdfnupとgs (ghostscript)を入れておく。
  2. ファイル毎にpdfnupで、n-up化しておく。 例えば、2x3の6-upにするコマンドの例は、 pdfnup --nup 2x3 --suffix 'nup' --frame true target1.pdf 等。
  3. N-up化したファイルを含め結合したいPDFをgsで結合する。 target0.pdfはそのまま、target1.pdfとtarget2.pdfはn-up化したものをつなげるコマンドの例は、 gs -q -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sOutputFile=merged.pdf target0.pdf target1-nup.pdf target2-nup.pdf 等。

応用

1つのファイルのPDFにおいて、ページ単位でn-upを変更したいなら、ghostscript等でPDFをページ単位でばらしてから、上記方法で再結合すればよい。
PDFのばらし方は、 https://srad.jp/~geln12/journal/542158/ 等で紹介されている模様。

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1