From 3d175495c92bb7ba43380ac76c38dcfd833788b4 Mon Sep 17 00:00:00 2001 From: Fabrice Quenneville Date: Mon, 23 Sep 2024 16:53:44 -0400 Subject: [PATCH] Add notes on pdftk for PDF manipulation - Included basic commands for common PDF tasks using pdftk - Added instructions for: - Merging PDFs - Appending one PDF to another - Cutting specific pages from a PDF - Splitting PDFs into individual pages - Rotating PDF pages - Encrypting PDFs with a password This commit provides essential pdftk commands for managing and manipulating PDF files. --- notes/pdftk.md | 57 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 notes/pdftk.md diff --git a/notes/pdftk.md b/notes/pdftk.md new file mode 100644 index 0000000..5af3cf1 --- /dev/null +++ b/notes/pdftk.md @@ -0,0 +1,57 @@ +# pdftk + +## Table of Contents + +- [pdftk](#pdftk) + - [Table of Contents](#table-of-contents) + - [Basic Commands](#basic-commands) + +## Basic Commands + +**Merge PDFs** + +To merge two PDFs, use: + +``` +pdftk file1.pdf file2.pdf cat output merged.pdf +``` + +**Append PDF** + +To append one PDF to another, use: + +``` +pdftk A=first.pdf B=second.pdf cat A B output combined.pdf +``` + +**Cut pages from PDF** + +To only keep the first page: + +``` +pdftk file1.pdf cat 1-1 output output.pdf +``` + +**Split PDF** + +To split a PDF into single pages, use: + +``` +pdftk input.pdf burst output page_%02d.pdf +``` + +**Rotate PDF Pages** + +To rotate pages in a PDF, use: + +``` +pdftk input.pdf cat 1-endsouth output rotated.pdf +``` + +**Encrypt PDF** + +To encrypt a PDF with a password, use: + +``` +pdftk input.pdf output encrypted.pdf user_pw yourpassword +```