Extended PDF Manipulation Toolkit
Project description
PDF Toolkit 🔖
A Swiss Army knife for PDF manipulations with Markdown conversion capabilities
Features ✨
- Merge PDFs with regex filename filtering
- Split PDFs by:
- Page ranges (e.g., "1-3,5-8")
- Fixed page chunks (e.g., every 5 pages)
- Special "all" keyword for full document split
- Convert Markdown ↔ PDF:
- Preserve formatting with custom CSS styles
- Basic text extraction from PDF to Markdown
- CLI Interface with intuitive subcommands
- Pipx Installable for easy system-wide use
Installation 📦
pipx install pdf2s
System Requirements:
- Python 3.8+
- libpangocairo-1.0-0 (for WeasyPrint)
- Ubuntu/Debian:
sudo apt-get install libpangocairo-1.0-0
- Ubuntu/Debian:
Usage 💻
$ pdf-toolkit --help
Usage: pdf-toolkit [OPTIONS] COMMAND [ARGS]...
Commands:
merge Merge PDF files
split Split PDF files
md2pdf Convert Markdown to PDF
pdf2md Convert PDF to Markdown
Merge PDFs
# Merge all PDFs in directory (sorted)
pdf-toolkit merge ./documents merged.pdf --sort
# Merge only files matching regex pattern
pdf-toolkit merge ./reports final_report.pdf -r 'Q[1-4]_2023'
Split PDFs
# Split into individual pages
pdf-toolkit split input.pdf output_dir
# Split every 5 pages
pdf-toolkit split input.pdf output_dir --pages 5
# Split specific ranges
pdf-toolkit split input.pdf output_dir --ranges "1-3,5-8"
# Split entire document
pdf-toolkit split input.pdf output_dir --ranges "all"
Markdown Conversion
# MD to PDF with custom styling
pdf-toolkit md2pf input.md output.pdf --style styles.css
# PDF to Markdown
pdf-toolkit pdf2md input.pdf output.md
Development 🛠️
- Clone repository
- Install dependencies:
pipx install poetry
poetry install
- Run tests:
poetry run pytest
Contributing 🤝
Contributions are welcome! Please:
- Fork the repository
- Create a feature branch
- Submit a Pull Request
Report issues using the GitHub Issues tracker.
License 📄
This project is licensed under the MIT License - see the LICENSE file for details.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
pdf2s-0.1.0.tar.gz
(6.7 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
pdf2s-0.1.0-py3-none-any.whl
(7.1 kB
view details)
File details
Details for the file pdf2s-0.1.0.tar.gz.
File metadata
- Download URL: pdf2s-0.1.0.tar.gz
- Upload date:
- Size: 6.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
409e15a14bcb3246a25043c26ccf9f813ed47ad33f4c10f3b26177eab7436042
|
|
| MD5 |
59c04bfce69bf8850f6cfbc195b3f7a1
|
|
| BLAKE2b-256 |
bb070e99c0f982182fc3f4103d565b3c37019cdce682cff1f9002e37b6598790
|
File details
Details for the file pdf2s-0.1.0-py3-none-any.whl.
File metadata
- Download URL: pdf2s-0.1.0-py3-none-any.whl
- Upload date:
- Size: 7.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9405c976734ccad4522419091559fee8891e9d4cff9de188596e2ae84d28d1b6
|
|
| MD5 |
d049c799736837284afa4bc6b8674b31
|
|
| BLAKE2b-256 |
6a7ee2f6b732ba71357daa66d456de87f126ea480f9efb2f522b4de32893645e
|