Jack Strain

A collection of things I found useful.

Simple PDF Tasks on Ubuntu/Linux

2023-09-28 23:35

Converting PDFs to Images

Required is the poppler-utils package, which should be installed by default on Ubuntu.
For a whole file:
pdftoppm input.pdf outputname -png
For one or more pages of a file:
pdftoppm input.pdf outputname -png -f {page} -singlefile
where {page} is the page number, i.e. -f 1 would be the first page.
A range can be specified like so -f 1 -l 5 where -l specifies the last page.

Compressing PDFs

Compression can be achieved with ps2pdf like so:
ps2pdf input.pdf output.pdf