PDFtk is a command-line program. Use your computer terminal or command prompt when running these examples.
Interleave even and odd scanned pages into a single document:
pdftk A=even.pdf B=odd.pdf shuffle A B output collated.pdfIf the odd pages are in reverse order:
pdftk A=even.pdf B=odd.pdf shuffle A Bend-1 output collated.pdfRemove encryption from a PDF using its password:
pdftk secured.pdf input_pw foopass output unsecured.pdfApply owner password encryption:
pdftk 1.pdf output 1.128.pdf owner_pw foopassRequire a password to open the PDF as well:
pdftk 1.pdf output 1.128.pdf owner_pw foo user_pw bazEncrypt while still allowing printing:
pdftk 1.pdf output 1.128.pdf owner_pw foo user_pw baz allow printingMerge multiple PDFs into one:
pdftk in1.pdf in2.pdf cat output out1.pdfUsing handles for explicit control:
pdftk A=in1.pdf B=in2.pdf cat A B output out1.pdfUsing wildcards to merge all PDFs in a directory:
pdftk *.pdf cat output combined.pdfExclude page 13 from a document:
pdftk in.pdf cat 1-12 14-end output out1.pdfUsing a handle:
pdftk A=in1.pdf cat A1-12 A14-end output out1.pdfMerge and encrypt with 40-bit strength:
pdftk 1.pdf 2.pdf cat output 3.pdf encrypt_40bit owner_pw foopassSupply the password for the encrypted input:
pdftk A=secured.pdf 2.pdf input_pw A=foopass cat output 3.pdfDecompress internal streams for inspection or debugging:
pdftk doc.pdf output doc.unc.pdf uncompressPass a broken PDF through pdftk to attempt repair:
pdftk broken.pdf output fixed.pdfSplit each page into its own file:
pdftk in.pdf burstBurst with encryption and limited printing:
pdftk in.pdf burst owner_pw foopass allow DegradedPrintingExport bookmarks, metadata, and page metrics:
pdftk in.pdf dump_data output report.txtRotate the first page 90 degrees clockwise:
pdftk in.pdf cat 1east 2-end output out.pdfRotate all pages 180 degrees:
pdftk in.pdf cat 1-endsouth output out.pdfPopulate form fields from an FDF file:
pdftk form.pdf fill_form data.fdf output filled_form.pdfFlatten the form after filling (prevents further editing):
pdftk form.pdf fill_form data.fdf output filled_form.pdf flattenStamp a watermark behind every page:
pdftk input.pdf background watermark.pdf output watermarked.pdfApply an overlay PDF on top of every page:
pdftk input.pdf stamp overlay.pdf output stamped.pdfEmbed files as attachments:
pdftk input.pdf attach_files table.html graph.png output output.pdfUnpack all embedded files:
pdftk input.pdf unpack_files output /path/to/output/