PDFwerks is a lightweight yet comprehensive, tool for working with PDFs. It provides essential PDF manipulation tools all in one easy to use package. All operations are performed locally on your machine, ensuring your sensitive documents stay secure and private. With PDFwerks, you can finally say goodbye to uploading your documents to shady websites or paying for basic PDF operations.
Check out the official documentation here: PDFwerks Documentation. It's more detailed and well I put a lot of effort, so go see it :)
PDFwerks is a cross platform PDF toolkit and works across all major operating systems.
It has been locally tested and verified on both Ubuntu (including WSL2) and Windows. Additionally, Continuous Integration (CI) tests are run on Windows, macOS, and Ubuntu, ensuring core functionality remains stable across environments.
⚠️ Important:tkinteris a required dependency for PDFwerks. For OS specific installation instructions, see the PDFwerks Documentation
You can install PDFwerks using pip:
pip install pdfwerksRun the tool directly from your terminal with:
pdfwerksYou can also use PDFwerks through the CLI for quick PDF operations without using the TUI.
pdfwerks merge file1.pdf file2.jpg [file3.pdf ...] [-o OUTPUT]- Merge two or more files into one PDF. (Supported File Types:
*.pdf,*.jpg,*.png,*.jpeg,*.txt) - Use
-oor--outputto specify the output file path. (Defaults to~Downloads/merged.pdfif not specified)
pdfwerks compress file.pdf [--level LEVEL] [-o OUTPUT]- 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)
pdfwerks convert-image file.jpg [-o OUTPUT]- Converts any image to a PDF file (Supported File Types:
*.jpg,*.png,*.jpeg) - Use
-oor--outputto specify the output file path. (Defaults to~Downloads/converted.pdfif not specified)
pdfwerks extract file.pdf --format [text|markdown|json] [-o OUTPUT]- 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. - Use
-oor--outputto specify the output file path. (Defaults to~Downloads/extracted.[format]if not specified)
pdfwerks enable-pwd file.pdf --pwd PASSWORD [-o OUTPUT]- 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)
pdfwerks disable-pwd file.pdf --pwd PASSWORD [-o OUTPUT]- 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)
pdfwerks update-pwd file.pdf --old-pwd OLD_PASSWORD --new-pwd NEW_PASSWORD [-o OUTPUT]- 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)
pdfwerks delete-pages file.pdf --pages PAGES [-o OUTPUT]- 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)
pdfwerks --help
pdfwerks --versionIf you want to test, contribute or customize the tool locally:
-
Clone the repository:
git clone https://github.com/adithya-menon-r/PDFwerks.git cd PDFwerks -
Create a virtual environment and activate it:
python -m venv .venv .venv\Scripts\activate # On Linux/Mac: source .venv/bin/activate
-
Install dependencies and the package in editable mode:
pip install -e .
Depending on what you are working on, you can install extras as needed:
-
For tests:
pip install -e .[test]
-
For documentation:
pip install -e .[docs]
You can now make changes to the code, run tests, or build documentation without reinstalling the package.
Once test dependencies are installed (using pip install -e .[test]), you run the full test suite with:
pytestAll test files are located in the tests/ directory and are automatically discovered by pytest.
PDFwerks is licensed under the MIT LICENSE
PDFwerks is developed and maintained by Adithya Menon R
