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 and kerning (using wordaxe).

  • 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

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 .

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

rst2pdf wishes to be a welcoming community. With that in mind, please refer to 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.98.tar.gz (11.3 MB view details)

Uploaded Source

Built Distribution

rst2pdf-0.98-py3-none-any.whl (170.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: rst2pdf-0.98.tar.gz
  • Upload date:
  • Size: 11.3 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/49.6.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.7.7

File hashes

Hashes for rst2pdf-0.98.tar.gz
Algorithm Hash digest
SHA256 10240482bcdf93e28e2300e4742fc5ce54c445deb001d54ae3c627419607e51c
MD5 e69ec43a091024e62f375e471c5c2c81
BLAKE2b-256 8c6c5f06345b668f1ede9480276043b6eaf993d2b3dda490ba9f8417a8c3144c

See more details on using hashes here.

File details

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

File metadata

  • Download URL: rst2pdf-0.98-py3-none-any.whl
  • Upload date:
  • Size: 170.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/49.6.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.7.7

File hashes

Hashes for rst2pdf-0.98-py3-none-any.whl
Algorithm Hash digest
SHA256 263b6d59e4aeef063999cc66d27178a59a0ad7e91643142c2787605ecf4d0269
MD5 7b0064a1725b4ca7d94a51cbdb25d38f
BLAKE2b-256 ecb15e1d8d769fd2e713eda3bb75d7a46a8ef660119909f180d282df64b79ce2

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