You may find the pdfarranger program useful for doing this in a GUI. Of course, if you really want a scripted solution then your current way is better.

raph@X1:~/src/Music/Songs$ dpkg -s pdfarranger
Package: pdfarranger
Status: install ok installed
Priority: optional
Section: graphics
Installed-Size: 752
Maintainer: Ubuntu Developers <ubuntu-devel-disc...@lists.ubuntu.com>
Architecture: all
Version: 1.10.1-1
Depends: python3-dateutil, python3-pikepdf, python3:any, gir1.2-glib-2.0, gir1.2-gtk-3.0, gir1.2-poppler-0.18, python3-cairo, python3-gi, python3-gi-cairo, python3-pkg-resources
Recommends: python3-img2pdf
Description: merge, split and re-arrange pages from PDF documents
 PDF Arranger is a small application which allows one to merge or split pdf
 documents and rotate, crop and rearrange their pages using an interactive
 and intuitive graphical interface.
 .
 PDF Arranger was formerly known as PDF-Shuffler.
Original-Maintainer: Debian Python Team <team+pyt...@tracker.debian.org>
Homepage: https://github.com/pdfarranger/pdfarranger


On 09/02/2025 21:44, bobr...@centrum.is wrote:
I have a PDF which consists of 16 small scores in A4 landscape.  I want to print them in a signature booklet, 2up (top/bottom) on two sheets of A3 paper, duplex, of course.  After some experimentation I found a sequence of PDF manipulation commands which appeared to do exactly what I wanted.  I wrapped them up in a bash script (cygwin).  The script is as follows:

#!/bin/bash

# Use: input PDF filename w/o '.pdf' followed by number of logical pages

# set filename to be the input (do not include extension)
filename=$1.pdf

# rotate all pages 90º to the right
pdftk $1.pdf cat 1-endeast output $1-out.pdf

# stack rotated pages top/bottom
pdfjam $1-out.pdf --nup 1x2 --paper A4 --suffix 2up

# re-collate into book signature
pdfjam $1-out-2up.pdf --signature $2 --paper a3 --landscape --outfile $1-sig.pdf

# remove intermediate files
rm $1-out.* $1-out-2up.*

It *appears* to work perfectly.  The final output looks fine on my PDF viewer (Sumatra).  When printed out, however, the scores themselves are undersize.  They should be sized for A5  with four on one side of each A3 sheet and four on the other.  This is what I get, but they appear to be sized for A6 paper.  I want to emphasize that the only thing wrong is the printed size of the scores themselves.

Does anyone know how to fix this?

TIA

David


Reply via email to