The Computer Oracle

Converting a PDF to one with multiple pages per sheet through the command line

--------------------------------------------------
Rise to the top 3% as a developer or hire one of them at Toptal: https://topt.al/25cXVn
--------------------------------------------------

Music by Eric Matyas
https://www.soundimage.org
Track title: A Thousand Exotic Places Looping v001

--

Chapters
00:00 Converting A Pdf To One With Multiple Pages Per Sheet Through The Command Line
01:09 Accepted Answer Score 2
01:45 Answer 2 Score 22
02:02 Answer 3 Score 0
02:17 Answer 4 Score 6
02:34 Thank you

--

Full question
https://superuser.com/questions/596035/c...

--

Content licensed under CC BY-SA
https://meta.stackexchange.com/help/lice...

--

Tags
#ubuntu #commandline #pdf #printing #evince

#avk47



ANSWER 1

Score 22


You can also use pdfnup:

pdfnup --nup 2x2 --no-landscape file.pdf

where 2x2 refers to 2 rows by 2 columns (or the reverse--I'm not sure). See man pdfnup for more options.




ANSWER 2

Score 6


For me pdfnup was not available, and whilepdfxup did not work, pdfjam did:

pdfjam --nup 2x2 <infile>

To specify the output file name (in place of the autogenerated one) use the option --outfile

pdfjam --nup 2x2 <infile> --outfile <outfile>



ACCEPTED ANSWER

Score 2


to perform an IMPOSITION, nothing is better than Multivalent.jar (latest free version with tools inside, latest Multivalent build currently hosted on sourceforge - 2009 - has no more pdf tools)

you can download the Multivalent.jar build with tools from:

online man - http://multivalent.sourceforge.net/Tools/pdf/Impose.html

use:

java -cp path...to/Multivalent.jar tool.pdf.Impose -dim (rowsxcols) -paper (paper sizes where pages will be imposed) file.pdf



ANSWER 4

Score 0


The only tool I've found that can do this and is maintained is PyPDF2 https://pythonhosted.org/PyPDF2/index.html

You can see some example code at: https://superuser.com/a/1508283/590044