Skip to main content

Convert reStructured Text to PDF via ReportLab.

Project description

https://travis-ci.org/rst2pdf/rst2pdf.svg?branch=master https://img.shields.io/pypi/v/rst2pdf.svg https://img.shields.io/pypi/pyversions/rst2pdf.svg https://img.shields.io/pypi/l/rst2pdf.svg

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

  • Full user’s manual

Installation

rst2pdf supports Python 3.6 or greater. Version 0.97 was the last version to support Python 2.7.

Install from PyPI

The latest released version may be installed from PyPI by using pip:

$ pip install --user rst2pdf

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

$ pip install --user 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 master
$ pip install --user .

Note that you may need to use sudo python setup.py install or sudo python3 setup.py install in this final step, depending on your configuration.

You may want to install it in a virtualenv, but that is beyond the scope of this readme.

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

rst2pdf-0.99.tar.gz (12.1 MB view details)

Uploaded Source

Built Distribution

rst2pdf-0.99-py3-none-any.whl (176.8 kB view details)

Uploaded Python 3

File details

Details for the file rst2pdf-0.99.tar.gz.

File metadata

  • Download URL: rst2pdf-0.99.tar.gz
  • Upload date:
  • Size: 12.1 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.5.0 importlib_metadata/4.8.2 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

File hashes

Hashes for rst2pdf-0.99.tar.gz
Algorithm Hash digest
SHA256 8fa23fa93bddd1f52d058ceaeab6582c145546d80f2f8a95974f3703bd6c8152
MD5 dbec71c69c3a6b2915c52c529a3fd4ab
BLAKE2b-256 399245e06d31e69d4b3a6ec75826555ea0d03b8cb3a68f879d642af90db29f88

See more details on using hashes here.

File details

Details for the file rst2pdf-0.99-py3-none-any.whl.

File metadata

  • Download URL: rst2pdf-0.99-py3-none-any.whl
  • Upload date:
  • Size: 176.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.5.0 importlib_metadata/4.8.2 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

File hashes

Hashes for rst2pdf-0.99-py3-none-any.whl
Algorithm Hash digest
SHA256 5a4d032552a96de251c62ee1b926e5c5d51ef00345e9e7ce4505b9151d797cc0
MD5 49c07541d842d0078f7a7e7f75660241
BLAKE2b-256 99bdbbd07a473b254bbdf3796016c2a2a16de52ed6cbb3158fb8dc5a19f22a94

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page