Installation older
Installation up to version 2.x
These instructions are for older versions on ReportLab PLUS, prior to March 2014.
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.
There is one golden rule: your reportlab and rlextra versions must match!
PREREQUISITES
-
Download and install Python (version 3.3+, 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:
-
Python MegaWidgets. A windows installer can be downloaded here; the Ubuntu package name is python-pmw.
-
On Linux, you also need python TkInter (ubuntu package python-tk).
-
Version 3.0 of our libraries shipped on 14th February 2014. It is compatible with Python versions 2.7 to 3.3+. The new features are listed here.
Builds are also available in the download area - you need to be logged in to the site to access these.
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.
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) :
This step is only applicable to ReportLab PLUS license holders, or those who wish to use RML and PageCatcher for evaluation purposes. You need to be logged in to the site for the link below to work.
-
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...
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.