[ALUG] Reformatting a PDF

Brett Parker iDunno at sommitrealweird.co.uk
Thu May 18 11:22:11 BST 2017

On 17 May 15:19, Mark Rogers wrote:
> On 17 May 2017 at 14:35, Brett Parker <iDunno at sommitrealweird.co.uk> wrote:
> > The pages happen to be 1/3rd A4 size, so, something like:
> >
> >   pdfjam Royal-Mail-Our-Prices-March-2017_0.pdf --a4paper --landscape --nup 3x1 --outfile ~/test.pdf
> >
> > Should do what you're after.
> That's damn near perfect, thanks!
> The only tweak I needed was that the original contains 16 pages, with
> the last page being useless but preventing it fitting on 5 pages.
> Googling suggested that
> $ pdfjam Royal-Mail-Our-Prices-March-2017_0.pdf 1-15 --a4paper
> --landscape --nup 3x1 --outfile ~/test.pdf
> .. would do what I wanted but it didn't - the result wasn't a valid
> PDF.

Really? I just ran:

  pdfjam Royal-Mail-Our-Prices-March-2017_0.pdf '1-15' --a4paper --landscape --nup 3x1 --outfile ~/temp.pdf

and it seemed to generate something that was perfectly fine in evince.

> So I tried two steps:
> $ pdfjam Royal-Mail-Our-Prices-March-2017_0.pdf 1-15 --outfile ~/test.pdf
> $ pdfjam ~/test.pdf --a4paper --landscape --nup 3x1 --outfile ~/test2.pdf
> .. which extracted the right pages but screwed up the layout.
> In the end I combined knowledge from elsewhere in this thread to get:
> $ pdftk Royal-Mail-Our-Prices-March-2017_0.pdf cat 1-15 output tmp.pdf
> $ pdfjam tmp.pdf --a4paper --landscape --nup 3x1 --outfile result.pdf
> The result is spot on but I'd be interested to know where I went wrong
> trying to do this in a single step with pdfjam?

Dunno, unless it really does parse '1-15' different to 1-15, which would
be odd indeed!

Really, looking at how that booklet is supposed to be folded, it looks
like "all the fun" to actually print it in a way where you can fold it
correctly in to the actual leaflet.

Brett Parker

More information about the main mailing list