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 templating language, Preppy
- A commercial package containing all our commercial Python utilities - rlextra
- Download and install Python (version 2.7, 2.6 OR 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.
- To use Diagra, you will need to download and install the following:
Version 2.7 of our libraries shipped on 4th April, 2013. It's compatible with Python versions from 2.5 to 2.7. The new features are listed here.
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 following the Unix instructions later on in this guide.
1. Install the open source library (.exe installer):
- Download the Reportlab 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. Alternatively, follow the installation instructions on our Bitbucket page.
2. Install ReportLab PLUS.
The .exe installer includes RML and PageCatcher. Preppy and pyRXP are now external packages, see our Open Source page for more details.
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. Optional extras
These installers will provide only the runtime code, with no docs or tests. These are available by downloading the full unix source packages as described later in this guide.
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 the ReportLab PLUS commercial package (rlextra) :
Download the rlextra package:
Unpack the archive, change into the rlextra directory and run 'python setup.py install' (you may need to be root).
3. Test your installation:
Once you have everything installed, you can test your installation by running 'python testall.py' in the rlextra/tests/ 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...
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.