Linux: PDF Modifications

How to alter PDF files in Linux…

Concatenation of Multiple PDF Files

Install PDFTK and execute:

pdftk FILE0.pdf FILE1.pdf FILE2.pdf cat output OUTPUTFILE.pdf

and that’s pretty much it 🙂

Split PDF File Into Single Pages

pdftk INPUT.pdf burst output OUTPUT_%02d.pdf

alternatively:

pdftk INPUT.pdf burst output OUTPUT_%02d.pdf compress

Insert a Header into a PDF File

Create a header PDF file (for instance, in LibreOffice) and execute:

pdftk SOURCEFILE.pdf background HEADER.pdf output OUTPUTFILE-HEADER.pdf

That’s pretty much it 🙂

Split a PDF File into Selected Range of Pages

To select, for instance, only pages two to five, use the following:

pdftk SOURCEFILE.pdf cat 2-5 output SELECTED.pdf dont_ask

That’s pretty much it 🙂

Rearrange Pages in a PDF File

I believe, the command is pretty straightforward:

pdftk SOURCEFILE.pdf cat 3 1-2 4-end output OUTPUTFILE.pdf

That’s pretty much it 🙂

Resize All Pages in a PDF File to a Selected Size

Resize to A4 size, using Ghostscript execute:

gs 
 -o output.pdf 
 -sDEVICE=pdfwrite 
 -sPAPERSIZE=a4 
 -dFIXEDMEDIA 
 -dPDFFitPage 
 -dCompatibilityLevel=1.4 
  input.pdf

And yes, that’s pretty much it 🙂

Advertisements
This entry was posted in Linux and tagged , , , , . Bookmark the permalink.