Library / SDK
rst2pdf/rst2pdf avatar
rst2pdf/rst2pdf

rst2pdf: reStructuredText to PDF without going through LaTeX

Use a text editor. Make a PDF.

600 stars157 forksPythonMIT

At a glance

What is it?
rst2pdf converts reStructuredText to PDF directly with ReportLab instead of routing through LaTeX, with user-defined page layouts, a cascading stylesheet mechanism, custom fonts and a Sphinx pdf builder. It is MIT licensed, on PyPI as a command line tool, and now requires Python 3.11 or newer.
Who is it for?
Adopt rst2pdf if you author in reStructuredText, you want PDF output without installing or maintaining a LaTeX toolchain, and you need the layout control that a report generator offers, such as multiple frames per page, custom page sizes and a stylesheet you only partly redefine. Skip it if your document depends on the wider LaTeX ecosystem, since LaTeX gives you packages this route does not reproduce, and skip it if you cannot move to Python 3.11.
Can I use it commercially?
Yes. MIT is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
Is it still maintained?
Yes. The repository last received commits 1 day ago.
What is it written in?
Mainly Python, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on October 22, 2026, and from our analysis. They are not legal advice.

Editorial analysis

The alternative to the LaTeX route

The usual way of creating a PDF from reStructuredText is by going through LaTeX, and this tool exists to provide an alternative by producing the PDF directly using the ReportLab library. That single sentence is the whole pitch, and it is worth taking seriously, because the LaTeX route carries a large amount of incidental cost. A LaTeX pipeline means a TeX distribution, a package manager for TeX packages, a font configuration, and a build step whose failure modes are unfamiliar to anyone who has not debugged a TeX error. rst2pdf replaces all of that with a Python package and a command, which means the same environment that runs your document build probably already has what it needs. The dependency list in the pyproject file confirms the shape of the alternative, with docutils for the reStructuredText parsing, reportlab at about 4.0 for the PDF generation, Pygments for syntax highlighting, jinja2, pyyaml and packaging. The result is a tool for people who write in a text editor and want a PDF at the end of it, with the emphasis on the directness of that path rather than on matching what LaTeX can do.

Page layout is the feature that LaTeX users will look for

The feature list starts with user-defined page layout, multiple frames per page and multiple layouts per document, and that is the capability that most directly separates this from a naive converter. A frame is a region of the page with its own position and dimensions, and a stylesheet can then target content differently depending on which frame it lands in, so a document can have a wide margin column for notes beside a main text column, or a running header frame and a body frame, without the author hand-placing every element. Multiple layouts per document means the same source can produce different page arrangements depending on context. There is also support for page transitions, which is a LaTeX-ism carried over from the beamer package and useful for presentation-style output. The rest of the layout controls cover custom page sizes and margins, and the ability to define any number of paragraph styles through the class directive and any number of character styles through text roles. The mechanism for that last pair is the cascading stylesheet, where the documentation describes a mechanism in which you define only what you want changed, which is the reStructuredText way of doing things and keeps the source readable.

Fonts, images, hyphenation and syntax highlighting

Font handling is the other area where a report generator either works or does not. The feature list states support for TTF and Type1 font embedding, which means you can specify a typeface in your stylesheet and have it embedded in the PDF, so the document renders the same on a machine that does not have the font installed. That is the difference between a document that travels and one that only looks right on the author's laptop. Images are covered by a promise to support embedding almost any kind of raster or vector images, and the optional dependency list shows how that promise is kept: svglib for SVG support, aafigure for the aafigure format, and matplotlib for mathematical figures. Hyphenation is supported, which for a text-heavy report written in a proportional font is the difference between a justified page with even word spacing and one with rivers of white running down the page. Syntax highlighting for many languages comes from Pygments, and it is used in code blocks, which is what makes a technical document with listings look like a typeset book rather than a monospaced dump.

Installing it, and the extras that decide your features

The installation section gives four routes, and the interesting detail is the extras. The recommended route is pipx, and the plain install is a single command.

bash
    $ pipx install rst2pdf

The features that need extra dependencies are opt-in extras, and the README lists them all in one command.

bash
    $ pipx install rst2pdf[aafiguresupport,mathsupport,plantumlsupport,rawhtmlsupport,sphinx,svgsupport]

The same two commands are given for uv, with uv tool install rst2pdf, and there is a snap channel for systems that support snaps, installed with snap install rst2pdf. The extras map directly onto the features: aafigure support, math support, plantuml support, raw HTML support, sphinx and svg support. The pyproject file lists the same set as optional dependencies, with aafigure, matplotlib, plantuml, xhtml2pdf, sphinx and svglib respectively, and the raw HTML one is worth noting since xhtml2pdf is a separate rendering engine brought in for that feature alone. The pattern of pipx or uv rather than a plain pip install is deliberate, since both isolate the tool in its own environment, and for a document converter that is usually the right default, since it keeps the tool's own dependencies away from the environment your other scripts share.

Converting a document and wiring it into Sphinx

Converting a document is the command you would expect, with the document name and the output file as arguments.

bash
    $ rst2pdf <document name> output.pdf

The available options are listed with the help flag.

bash
    $ rst2pdf -h

The Sphinx integration is the feature that matters most if your documents are already in a Sphinx project. You modify your conf.py file to enable the rst2pdf.pdfbuilder extension and configure the pdf_documents option.

python
    extensions = [
        # ...
        'rst2pdf.pdfbuilder',
    ]

    # Grouping the document tree into PDF files. List of tuples
    # (source start file, target name, title, author, options).
    pdf_documents = [
        ('index', 'MyProject', 'My Project', 'Author Name'),
    ]

So a Sphinx site gains a PDF build alongside its HTML output, and the pdf_documents option is where you say which source tree becomes which PDF, with a title and an author per document and an options dictionary. The manual covers that option and many others, and the sphinx extra is the one that installs the Sphinx package itself, which is why it is opt-in rather than a hard dependency.

Python version support is moving, and the history says so

The installation section states that rst2pdf supports Python 3.11 or greater, and it gives the history of the drops, which is more useful than the single number. Version 0.105 was the last version to support Python 3.10, version 0.103 was the last to support Python 3.9, and version 0.102 was the last to support Python 3.8. The release list lines up with that, with 0.105 on 2026-03-09, 0.104 on 2026-01-08 and 0.103.1 on 2024-12-24. The current pyproject file confirms the floor with requires-python set to 3.11 or newer, and the classifiers list Python 3.11 through 3.15, which tells you the project tracks new interpreter releases as they appear rather than lagging them. The development status classifier is Development Status :: 4 - Beta, so the project is explicit about its own stage, and the licence classifier plus the LICENSE.txt file confirm MIT terms. If you are on an older Python, the fix is to pin an older rst2pdf rather than to attempt a source install, since the code itself will use newer syntax and libraries.

Where rst2pdf is the wrong tool

The boundary is the LaTeX ecosystem. rst2pdf is a direct renderer for reStructuredText, and it does not attempt to be a LaTeX implementation, so anything that depends on a TeX package, a TeX macro, a bibliography style file or a specific LaTeX layout engine is out of reach. Mathematics is the case most people hit, because LaTeX's equation handling is a feature in its own right while the mathematics support here is an extra backed by matplotlib, which renders figures rather than typesetting equations in place. Raw HTML is another, with xhtml2pdf as a separate engine behind an extra. A second limit is that the layout model is the document's own, not a template's, so the kind of multi-column and float-heavy magazine or report layout that comes from a real publishing tool is not what this produces. The third is the maintenance signal. The README says work on rst2pdf has restarted on GitHub, with the goals of adding new features, addressing outstanding issues, and not breaking anything, and the release list shows a gap from 0.103.1 in December 2024 to 0.104 in January 2026. The last push was on 2026-10-19 and the project is not archived, so it is being worked on, but the pace of releases and the stated restart both suggest checking the current state of a feature before you rely on it.

Editorial conclusion

Adopt rst2pdf if you author in reStructuredText, you want PDF output without installing or maintaining a LaTeX toolchain, and you need the layout control that a report generator offers, such as multiple frames per page, custom page sizes and a stylesheet you only partly redefine. Skip it if your document depends on the wider LaTeX ecosystem, since LaTeX gives you packages this route does not reproduce, and skip it if you cannot move to Python 3.11. Verify first which Python version your environment has, given the stated drop of 3.10 at version 0.105 and 3.9 at 0.103, and which optional extras your documents need, since figures, mathematics and raw HTML each pull in a separate dependency.

Frequently asked questions

How do I install rst2pdf and convert a document?

Install it with pipx install rst2pdf, or uv tool install rst2pdf, or snap install rst2pdf. Then run rst2pdf with the document name and the output file, for example rst2pdf <document name> output.pdf, and use rst2pdf -h to see the available options.

Which Python versions does rst2pdf support?

Version 0.105 and later require Python 3.11 or greater. The README records that 0.105 was the last version to support Python 3.10, 0.103 the last for Python 3.9, and 0.102 the last for Python 3.8.

How do I get Sphinx to build PDFs with rst2pdf?

In your conf.py, add 'rst2pdf.pdfbuilder' to the extensions list and configure the pdf_documents option as a list of tuples of source start file, target name, title, author and options. The sphinx extra must be installed for this to work.

Official sources

  1. License: MIT
  2. Project website
  3. README
  4. Releases
  5. rst2pdf/rst2pdf on GitHub
Add this badge to your README

If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.

Add this badge to your README

markdown
[![Hysen Labs](https://hysenlabs.com/badge/rst2pdf-rst2pdf.svg)](https://hysenlabs.com/projects/rst2pdf-rst2pdf)

Was this useful?