pdfitdown Python package provides a native interface to the Rust PdfItDown engine via PyO3 and Maturin.
Installation
Supported Formats
| Category | Formats |
|---|---|
| Markup | .md, .html, .htm |
| Office | .docx, .xlsx, .pptx |
| Images | .png, .jpg, .jpeg, .webp, .tiff, .avif |
| Text | .txt, .csv, .xml, .json, and more |
| Other | .pdf (pass-through) |
CLI
The package installs apdfitdown CLI entry point:
Python API
Import theConverter class from pdfitdown.pdfconversion:
Convert a single file
Convert multiple files
output_paths, PDFs are written next to the inputs with .pdf extension.
Convert a directory
Error handling
All methods raise standard Python exceptions on failure (e.g.IOError when an output file exists and overwrite=False).