Tuesday, March 20, 2018

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


Let us say I want slides.pdf to contain 4 slides per page.


I can open a slides.pdf document under evince (the default Ubuntu document viewer)


evince slides.pdf-->Print-->Page Setup--> Pages per Side --> 4 (or some other number)


Then, I can indicate I want to print to a file, and print. The result is an output.pdf file with the desired number of slides per sheet.


I want to achieve this same functionality through the command line (as I need to incorporate this into a script). All I have found some far are solutions relying on external tools. For example, I tried installing pdfjam (which required me to install 88.1 MB worth of packages from texlive-latex-base in order to achieve a functionality that I already have!), The result was only failure with pdfjam ERROR: LaTeX package pdfpages.sty is not installed.


I would rather avoid external packages.


How do I achieve this through the command line?


Answer



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

No comments:

Post a Comment

hard drive - Leaving bad sectors in unformatted partition?

Laptop was acting really weird, and copy and seek times were really slow, so I decided to scan the hard drive surface. I have a couple hundr...