Convert reStructured Text to PDF via ReportLab.
Project description
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 ReportLab library.
More information is available at the main website.
Features
User-defined page layout. Multiple frames per page, multiple layouts per document.
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
Installation
rst2pdf supports Python 3.8 or greater. Version 0.99 was the last version to support Python 3.6 & 3.7, with 0.97 the last version to support Python 2.7.
Install from PyPI
The latest released version may be installed from PyPI by using pipx:
$ pipx install rst2pdf
rst2pdf also has support for a number of features that require additional dependencies. Installation of all the required dependencies using pipx may be installed using:
$ pipx install rst2pdf[aafiguresupport,mathsupport,plantumlsupport,rawhtmlsupport,sphinx,svgsupport]
Install from Snap
If you are using a system that supports snaps then you can install from there with:
$ snap install rst2pdf
Install from GitHub
Work on rst2pdf has restarted on GitHub, with the goals of adding new features, addressing outstanding issues, and not breaking anything. You can 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 $ pipx install .[aafiguresupport,mathsupport,plantumlsupport,rawhtmlsupport,sphinx,svgsupport]
If you intend to work on rst2pdf’s source code, see doc/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 your conf.py file to enable the rst2pdf.pdfbuilder extension and configure the pdf_documents option. 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 the pdf_documents option and the many other options available, refer to the manual.
Contributing
See CONTRIBUTING.
Code of conduct
rst2pdf is an inclusive and welcoming community. To participate in this project, everyone is bound by our Community Code of Conduct.
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
Built Distribution
File details
Details for the file rst2pdf-0.102.tar.gz
.
File metadata
- Download URL: rst2pdf-0.102.tar.gz
- Upload date:
- Size: 12.1 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.0 CPython/3.11.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 37300624e953a73eddddcbae6f24630ef5467c20beeb58df648adc530844f425 |
|
MD5 | efc988aad53f1568d560c4b4cb34ce84 |
|
BLAKE2b-256 | 9616e9d568ddc7e7a60868f389189fe8b2ab216dc251b8922ae03b38aede50bf |
File details
Details for the file rst2pdf-0.102-py3-none-any.whl
.
File metadata
- Download URL: rst2pdf-0.102-py3-none-any.whl
- Upload date:
- Size: 177.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.0 CPython/3.11.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ae8e76aa85f95cef1ffcee30b3a53cbe15ffea185c274d093581b9be79b0ec10 |
|
MD5 | 1f4cab3afe8cf55d01a5a1aa213e5c8a |
|
BLAKE2b-256 | ec22e20fea65c5dc83d0652ccc357b9e7185757a147757fb834de63598b512e0 |