Skip to main content

Plugin backend renderer for reportlab.graphics.renderPM

Project description

(C) Copyright ReportLab Europe Ltd. 2000-2021. See LICENSE.txt for license details.

This is a plugin for the ReportLab PDF Toolkit. which constructs rich PDF documents, and also creation of charts in a variety of bitmap and vector formats.

This plugin is intended to replace most of the usage of the libart based C extension _renderPM which has been shown to have issues when rendering complex documents.

This backend can be brought into use by setting reportlab.rl_config.renderPMBackend = ‘rlPyCairo’ any of the methods detailed in reportlab/rl_config.py can be used to accomplish this.

The new backend seems able to handle all the same behaviour as _renderPM and the only place where it seems inferior is in the rendering of scaled images and the speed with which it draws text.

At present the rlPyCairo backend only uses the _renderPM extension to use its mapping of ReportLab font names to extract paths for rendering this is no doubt the reason for its slowness when rendering text.

Currently we are not making use of any of the more advanced abilities of PyCairo such as transparency, patterns etc, but that may change in the future.

Contents of this file:

  1. Licensing

  2. Installation

    2.1 General Prerequisites

    2.2 Source Distribution mercurial

  3. Prerequisites / Dependencies

  4. Documentation

  5. Tests

  6. Acknowledgements and Thanks

1. Licensing

BSD license. See LICENSE.txt for details.

2. Installation

In most cases, pip install reportlab`` will do the job.

2.1 General prerequisites

You need to have installed Python (versions 2.7 or >=3.6) and reportlab and ideally PIL or Pillow with Freetype support; more notes on prerequisites follow below.

2.2. Where to get the code

Latest sources are available from ReportLab’s open source download area:

https://hg.reportlab.com/hg-pulic/rlPyCairo

You can obtain the latest code from our Mercurial repository with:

hg clone https://hg.reportlab.com/hg-public/rlPyCairo

All released packages are available from our pypi at

https://www.reportlab.com/pypi/

Main releases are also available from the Python Package Index:

https://pypi.python.org/

A mirror only repository is available for git users at

https://github.com/MrBitBucket/rlPyCairo-mirror

please do not use this for issue reporting etc; use the mail list at

https://pairlist2.pair.net/mailman/listinfo/reportlab-users

3. Prerequisites / Dependencies

This works with Python versions 2.7 or >=3.6. Older versions are available going back to Python 1.5 or thereabouts.

There are no absolute prerequisites beyond the Python standard library; but the Python Imaging Library (PIL or Pillow) is needed to produce images with this package.

4. Documentation

There is no documentation other than that provided in the reportlab package about the standard renderPM renderer. This package is intended as an alternative to the lgpl_libart based backend reportlab.graphics._renderPM.

To enable this backend the reportlab.rl_config.renderPMBackend should be set to the string ‘rlPyCairo’. Use any of the methods outlined in reportlab/rl_config.py to accomplish this.

5. Test suite

Tests are in the reportlab/tests/ directory. They can be executed by cd’ing into the directory and executing python runAll.py with an envinment variable set as RL_renderPMBackend=rlPyCairo. Obviously you need to have rlPyCairo installed.

6. Acknowledgements and Thanks

Claude Paroz for failing examples of the base backend.

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

rlPyCairo-0.1.0.tar.gz (9.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

rlPyCairo-0.1.0-py2.py3-none-any.whl (10.2 kB view details)

Uploaded Python 2Python 3

File details

Details for the file rlPyCairo-0.1.0.tar.gz.

File metadata

  • Download URL: rlPyCairo-0.1.0.tar.gz
  • Upload date:
  • Size: 9.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.10.1

File hashes

Hashes for rlPyCairo-0.1.0.tar.gz
Algorithm Hash digest
SHA256 2f03e35a24dece85acea0a72a500cc3ec559a08779303fa8a8ef44bfb09c3491
MD5 68156d86554ddffbeaee4d0673048ab9
BLAKE2b-256 fa184415de2c2335a31e04f36ffb3311b0a3a5d928e5106e48e265d7f63d1338

See more details on using hashes here.

File details

Details for the file rlPyCairo-0.1.0-py2.py3-none-any.whl.

File metadata

  • Download URL: rlPyCairo-0.1.0-py2.py3-none-any.whl
  • Upload date:
  • Size: 10.2 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.10.1

File hashes

Hashes for rlPyCairo-0.1.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 cbbe9a01a9e7e78995cbde153cd7cd0b2f8a7285f35be62102ff7e17314f95fc
MD5 bf071768f68c72e7045b7cee023bc655
BLAKE2b-256 6dffce54390d38ef8d2f6f0f33bb6df4567af8a93ee6990b2b7dda6dd75db939

See more details on using hashes here.

Supported by

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