I have a RTL (right-to-left) pdf document and want to print it in booklet format so that it could be printed double sided and binded as a book.
There is simple solutions for LTR (left-to-right) documents, such as pdfbook
:
pdfbook inputfile.pdf
above simple command will create a new pdf file named inputfile-book.pdf
that could be printed double sided (duples printed "Long edge").
Is there a similar solution for right to left documents?
I foungI found a wokaround for this problem:
for 16 pages input file:
for 14 pages input file:
for 12 pages input file:
for 10 pages input file:
for 8 pages input file:
PHP Learner's answer worked, but I looked for another solution for several reasons. [These reasons include: pdfbook is no longer officially supported by the developers; I had to remove the asterisk in the signature switch in order to get it to do RTL; The workarounds given in that answer were only for specific numbered booklets, and I couldn't figure out how the numbering system worked, to extrapolate to other sized booklets]
Here's the solution using
pdfjam
:pdfjam --booklet 'true' --paper 'letter' --suffix 'book' --landscape --signature* '4' 'inputfile.pdf' --outfile ./
To break down the command:
pdfjam
==pdfjam is the engine behind the pdfbook script (pdfjam itself is a shell-script interface to the "pdfpages" LaTeX package)
--booklet 'true'
==this is what makes pdfjam print the pdf as a booklet, as opposed to all the pages in order
(this is a key value for '\includepdfmerge', in the LaTeX 'pdfpages' package)--paper 'letter'
==pdfjam uses A4 by default, this will tell it to use 8.5x11 size paper
--suffix 'book'
==this will automatically add the suffix '-book.pdf' to the inputfile name to create the output file name. In order for this to work, the output file must be a directory
--landscape
==make the booklet go along the long side of the page
--signature* '4'
==4 pages on a single doublesided page. The asterisk reverses the order of the pages, giving an RTL booklet
'inputfile.pdf'
==path to input file
--outfile ./
==when a directory is used, the file name will be $inputfile-book.pdf (since we chose book as the suffix earlier. A regular pdf filename can also be used here.)