rst2pdf is a Python library and command-line tool for converting reStructuredText documents to PDF format, leveraging the ReportLab library for PDF generation. It supports various reStructuredText features, including styles, images, and syntax highlighting. The current version is 0.105, and it maintains an active release cadence with frequent minor updates.
pip install rst2pdfVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to use the rst2pdf Python API to convert a reStructuredText string into a PDF file. The `rst2pdf` function from `rst2pdf.createpdf` is the primary programmatic interface.
Upgrade your Python environment to 3.10 or newer. Check `requires_python` on PyPI for the exact version range if using an older rst2pdf version.
Consult `ReportLab` and `Docutils` documentation for advanced styling, font embedding, or troubleshooting parsing issues. Ensure system-level dependencies for image processing (e.g., `libjpeg` for Pillow) are met for full functionality.
Review PDF output after upgrading to ensure typographical changes are as expected. If specific `smartypants` behavior is critical, consider pinning to an older rst2pdf version or pre-processing your reStructuredText.
No dependency data recorded yet.