(internal)

 

ReportLab Software Installation Guide

ReportLab's software comes as a set of Python libraries.

There is an open-source Python package ('reportlab') which delivers the core functionality to create PDF files (more details at www.reportlab.org ); a fast, validating XML parser (pyRXP); and a commercial package 'rlextra' containing all our commercial Python code.

Prerequisites

  • Download and install Python (version 2.5 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.

Latest version - 2.3

Version 2.3 of our libraries shipped on 4th Feb 2009. Don't confuse this with version 2.3 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.

Installation On Windows

Windows users with the requisite expertise and/or who wish to compile extensions themselves can 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.

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

First install the open-source toolkit:

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.

Then install the commercial toolkit. The installer includes RML, Preppy, PageCatcher and the pyRXP XML parser.

  • ReportLab Commercial Toolkit for Python 2.6, 2.5, 2.4, 2.3

You can now test your installation as follows:

  1. Open a command prompt and cd to c:\<Python2x>\lib\site-packages\rlextra
  2. Run the following command c:\<Python2x>\python.exe testall.py

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

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

Once installed, take the next steps...

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).

We describe a full installation here. The library will run and make PDFs without any C extensions or third party packages but some functionality and performance will be lost.

2. Installing 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':

3. Installing the commercial package (rlextra) :

  • Download the rlextra package for your version of Python: 2.6, 2.5, 2.4, 2.3
  • Unpack the archive and move the 'rlextra' directory within it to your 'site-packages' directory, or somewhere on your PYTHONPATH.

You can check your installation 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.

Once installed, 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.