Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Use a text editor. Make a PDF.

License

NotificationsYou must be signed in to change notification settings

rst2pdf/rst2pdf

Repository files navigation

rst2pdf: Use a text editor. Make a PDF.

The usual way of creating PDF from reStructuredText is by going through LaTeX.This tool provides an alternative by producing PDF directly using the ReportLablibrary.

More information is available at themain website.

Features

  • User-defined page layout. Multiple frames per page, multiple layouts perdocument.
  • Page transitions
  • Cascading stylesheet mechanism, define only what you want changed.
  • Supports TTF and Type1 font embedding.
  • Any number of paragraph styles using the class directive.
  • Any number of character styles using text roles.
  • Custom page sizes and margins.
  • Syntax highlighter for many languages, using Pygments.
  • Supports embedding almost any kind of raster or vector images.
  • Supports hyphenation.
  • Sphinx integration
  • Full user's manual

Installation

rst2pdf supports Python 3.9 or greater. Version 0.102 was the last version to support Python 3.8. Version 0.99 wasthe last version to support Python 3.6 & 3.7, with 0.97 the last version to support Python 2.7.

Install from PyPI (pipx)

The latest released version may be installed from PyPI by usingpipx:

$ pipx install rst2pdf

rst2pdf also has support for a number of features that require additional dependencies. Installation of all therequired dependencies usingpipx may be installed using:

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

Install from PyPI (uv)

As withpipx above, the latest released version may be installed from PyPI by usinguv:

$ uv tool install rst2pdf

If you don't haveuv, please seethe installation docs

Installation of all the required dependencies usinguv may be installed using:

$ uv tool install rst2pdf[aafiguresupport,mathsupport,plantumlsupport,rawhtmlsupport,sphinx,svgsupport]

Install from Snap

If you are using a system that supportssnapsthen you can install from there with:

$ snap install rst2pdf

Install from GitHub

Work on rst2pdf has restarted on GitHub, with the goals of adding newfeatures, addressing outstanding issues, and not breaking anything. Youcan clone the repository and install this version:

$ git clone https://github.com/rst2pdf/rst2pdf$ cd rst2pdf$ git checkout <desired-branch> # if you want something other than main$ uv tool install .[aafiguresupport,mathsupport,plantumlsupport,rawhtmlsupport,sphinx,svgsupport]

If you intend to work on rst2pdf's source code, seedoc/DEVELOPERS.rst.

Usage

To convert a reStructuredText document to a PDF, simply run:

$ rst2pdf <document name> output.pdf

For information on available options, use-h:

$ rst2pdf -h

To enable basic integration with Sphinx, modify yourconf.py file to enabletherst2pdf.pdfbuilder extension and configure thepdf_documentsoption. For example:

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'),]

For information on thepdf_documents option and the many other optionsavailable, refer to themanual.

Contributing

SeeCONTRIBUTING.

Code of conduct

rst2pdf is an inclusive and welcoming community. To participate in this project, everyone is bound by ourCommunity Code of Conduct.


[8]ページ先頭

©2009-2025 Movatter.jp