ReportLab Software Installation Guide

ReportLab's software comes as a set of Python libraries, consisting of:

  • An open-source Python package which delivers the core functionality to create PDF files (more details here)
  • A fast, validating XML parser - pyRXP
  • A commercial package containing all our commercial Python utilities - rlextra

Prerequisites

  • Download and install Python (version 2.5 or 2.6 recommended)
  • Download and install Python Imaging Library for the relevant version of Python. This is required for the use of bitmap images in your PDFs.
  • To use Diagra on Windows, you also need to download and install Python MegaWidgets. A windows installer can be downloaded here

Version 2.4 of our libraries shipped on 21th Jan 2010. Don't confuse this with version 2.4 of the Python language - you can use it with Python 2.3, 2.4, 2.5 or 2.6! The new features are listed here.

Daily builds are also available in the download area, which requires you to have an account on this site.

Installation On Windows

Windows users can download an installer for the relevant version of Python.

Alternatively, if you're a Windows user with the requisite expertise or you wish to compile the C extensions yourself, you can also install ReportLab by follow the Unix instructions below, but download the commercial packages ending in .zip rather than .tgz, which are the same but with Windows line endings.

1. Install the open source library (.exe installer):

Note that this only installs the libraries, and not the tests or manuals. Commercial users don't usually need separate documentation on the open source library, but if you want the docs and tests, they can be found in the equivalent Unix source package below.

2. Install ReportLab PLUS.

The .exe installer includes RML, Preppy, PageCatcher and the pyRXP XML parser.

This step is only applicable if you are a paying ReportLab PLUS license holder or you wish to use RML and PageCatcher for evaluation purposes. You need to have created a user account and be logged in for these links to work.

3. Test your installation:

Test your installation by opening a command prompt and type the following code (replace '<Python2x>' with the path to your Python installation):

cd c:\<Python2x>\lib\site-packages\rlextra
c:\<Python2x>\python.exe testall.py

This runs a series of test scripts which amongst other things, will create the documentation files.

4. Optional extras

We recommend that Windows users also install the Python Windows Extensions, a useful set of modules which includes COM support, WinAPI calls, ODBC and the PythonWin IDE.

If you are using our data-aware charts functionality with a database (Diagra), then you need this to make the ODBC connections.

Installation On Linux/Unix/Mac

1. Installing the open source library:

ReportLab's open source libraries are becoming available for many Linux distributions as a standard package you can install using the relevant package manager. However, this is often not the latest version and we do not prepare these ourselves. We recommend compiling from source to ensure that you have open source and commercial packages which are 'in sync' and released on the same date.

The open source library has some C extensions, and some dependencies at the C level - these include Python Imaging Library and the FreeType2 font engine. You will also need a C compiler installed. (On Ubuntu, you will need python-dev, build-essential, libfreetype6 and libfreetype6-dev; on a Mac, the separate XCode Tools should be installed).

The following instructions describes a full installation. The library will run and make PDFs without any C extensions or third party packages, but some functionality and performance will be lost.

  • Download the latest reportlab open source package from the download page.
  • Unpack the source archive and follow the instructions in README.TXT, install and then run the test suite.
  • From version 2.4 of reportlab, the standard fonts get downloaded through distutils. For previous versions you can manually Download the standard Type 1 PDF fonts and unzip them into the directory named 'fonts' that lives in the 'reportlab' package directory that you just installed (e.g. /usr/lib/python2.x/site-packages/reportlab/fonts).

2. Install pyRXP:

pyRXP is a very fast validating XML parser used by RML2PDF. Several of our example apps use it to parse XML data. Due to licensing requirements (GPL), it is packaged separately. A python package can be downloaded here and installed with the usual 'python setup.py install':

This is a C extension and thus needs a working compiler; if you're following these instructions 'out of order', see the note in the open source section about the C prerequisites.

3. Install the ReportLab PLUS commercial package (rlextra) :

This step is only applicable if you are a paying ReportLab PLUS license holder or you wish to use RML and PageCatcher for evaluation purposes. You need to have created a user account and be logged in for these links to work.

4. Test your installation:

You can check that you have everything installed correctly with our handy python script rl_check.py. This tries to import all the dependencies and reports on any missing or mismatched packages, and can be run from any location on your system.

Once you have everything installed, you can test your installation by running 'python testall.py' in the rlextra directory. This runs various test scripts, as well as creating the documentation files.

Now you're up and running, you can take the next steps...

Next Steps

The 'rlextra' folder and subfolders contain a large amount of sample code and other example files to help get you started, including copies of all the documentation. We recommend that you...

  • Browse the documentation
  • Check out the RML sample files online - also available within rlextra/rml2pdf/test/
  • Work through the ReportLab sample applications in the 'rlextra/examples' folder. The 'invoice' example is a good starting point and has a README explaining how we create data-to-PDF applications.