Skip to content

pdftools

compose multiple def files

1
pdftk input01.pdf input02.pdf cat output output.pdf

Cut a pdf file

how to cut a pdf file with 4 pages on each side ordered like:

1 3
2 4
1
2
mutool poster -x 2 original.pdf buffer.pdf
mutool poster -y 2 buffer.pdf cutted_version.pdf

as a script:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
#!/bin/bash
if [ $# -ne 2 ]
then
        echo usage $0 "<pdf_file> <output_file>"
        exit 1
fi

mutool poster -x 2 "$1" .buffer.pdf
mutool poster -y 2 .buffer.pdf "$2"
rm .buffer.pdf

shrink a pdf file

to shrink a pdf file you can use ghostscript:

1
gs -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/ebook -sOutputFile=output.pdf input.pdf

for -dPDFSETTINGS you can use the following setings:

  • /screen
  • /ebook
  • /printer
  • /prepress

compose multiple pages per sheet

via pdfnup (from package pdfjam):

1
pdfnup --nup 1x2 --no-landscape input.pdf

automatically crop pdf files

via pdfcrop (provided from package texlive-extra-utils)

1
pdfcrop input.pdf output.pdf