Getting Started
Haven't installed PDFwerks? Check the Installation instructions to install.
Usage via TUI
You can launch PDFwerks with a simple command:
This opens the interactive TUI (Text User Interface), allowing you to visually select and execute operations.
Usage via CLI
You can also use PDFwerks through the Command Line Interface (CLI) for quick PDF operations.
Merge PDFs
-
Merge two or more files into one PDF.
Supported File Types
You can input a mix of files - including
*.pdf,*.jpg,*.png,*.jpegand*.txt. All non-PDF files will be automatically converted to PDF before merging, so everything works seamlessly. -
Use
-oor--outputto specify the output file path. (Defaults to~Downloads/merged.pdfif not specified)
Compress PDFs
- Compress and reduce the size of a PDF file
- Use
--levelto choose the compression strength -low,medium(default), orhigh. - Use
-oor--outputto specify the output file path. (Defaults to~Downloads/compressed.pdfif not specified)
Convert Image to PDF
-
Converts any image to a PDF file
Supported File Types
Image files of the folowing types
*.jpg,*.pngand*.jpegare supported for conversion. -
Use
-oor--outputto specify the output file path. (Defaults to~Downloads/converted.pdfif not specified)
Extract Text
- Extract text from a PDF file and export it to the selected formats
-
Use
--formatto specify the export format. This is required and must be one of:text,markdown, orjson.Curious about the
jsonformat?The exported
jsonstores not only the extracted text but their positional metadata too. This is especially useful for devs working onOCRorDocument processing.The general output format looks like:
[ { "width": 612.0, // Width of Page "height": 792.0, // Height of Page // Blocks are sections of text in a page like paragraphs, sections, etc. "blocks": [ { "number": 0, // block number of the page "type": 0, // Bounding Box Values "bbox": [ 169.18162536621094, 36.8505859375, 456.63177490234375, 65.8974609375 ], // A block can be divided into lines "lines": [ { // A span is a continuous seq of chars that shares the same visual properties "spans": [ { "size": 26.0, "flags": 16, "bidi": 0, "char_flags": 24, "font": "Arial-BoldMT", "color": 0, "alpha": 255, "ascender": 0.800000011920929, "descender": -0.20000000298023224, "text": "HEADING TEXT", // Extracted text "origin": [ 169.18162536621094, 60.3876953125 ], "bbox": [ 169.18162536621094, 36.8505859375, 456.63177490234375, 65.8974609375 ] } ], "wmode": 0, "dir": [ 1.0, 0.0 ], "bbox": [ 169.18162536621094, 36.8505859375, 456.63177490234375, 65.8974609375 ] } ] }, // ... more blocks ] }, // ... more pages ] -
Use
-oor--outputto specify the output file path. (Defaults to~Downloads/extracted.[format]if not specified)
PDF Security
Enable Password Protection
- Enables password protection for a PDF file
- Use
--pwdto specify the new password for the file. This is required. - Use
-oor--outputto specify the output file path. (Defaults to~Downloads/encrypted.pdfif not specified)
Disable Password Protection
- Disables password protection for an encrypted PDF file
- Use
--pwdto specify the password for the encrypted PDF file. This is required. - Use
-oor--outputto specify the output file path. (Defaults to~Downloads/decrypted.pdfif not specified)
Update PDF Password
- Updates the password for a password protected PDF file
- Use
--old-pwdto specify the old password and--new-pwdto specify the new password for the PDF file. These are required. - Use
-oor--outputto specify the output file path. (Defaults to~Downloads/updated_pwd.pdfif not specified)
Delete Pages
- Deletes the specified pages from a PDF file
- Use
--pagesto specify pages to delete in the PDF file. Use commas and ranges, e.g.,1,3,5-7,10. This is required. - Use
-oor--outputto specify the output file path. (Defaults to~Downloads/deleted.pdfif not specified)