Skip to content

What's New In Reportlab 2.4

What's new in Version 2.4 - 21st Jan 2010. This covers both our open source and commercial software, which are always released together.

REPORTLAB PLUS

The ReportLab PLUS package is our new name for the combined distribution containing RML, PageCatcher, Diagra and our other supporting libraries. It delivers an importable Python package called 'rlextra' which works with the open source 'reportlab' package, whose changes are covered below.

We have switched to a new license file format. All the old license files will no longer work with version 2.4. Any customer with old-style license files should email us when upgrading and we can provide a new-style license file. This allows us to properly handle more customers situations, and only one file is needed (rather than separate RML, PageCatcher and Diagra licenses in the past).

REPORT MARKUP LANGUAGE (RML)

The main new features in RML aim to make long documents easier to generate, and to facilitate professional printing. There is an example script in rlextra/examples/longdoc which shows several of these features.

New attributes

  • pageNumber - countingFrom : in many longer documents, the page with '1' at the bottom is not actually the first page, coming after covers and prefaces. To correct for this we used to put nasty arithmetical expressions inside the pageNumber tag. One can now add a simple numeric offset.
  • lineStyle - dash : you can easily apply dash styles to the lines between the cells in tables
  • includePdfPages - sx, sy, dx, dy, degrees : when pulling in a page of an existing PDF document, you can scale it, shift it and rotate it. This is very useful if the pages to be included are slightly different in size or need to be minimised.
  • docinit - useCropMarks : this will make the page size larger and add printer's crop marks, without you needing to change any of your markup. This makes it much easier to generate documents which work for both electronic delivery and professional printing, without needing to recalculate the positions of all the elements.

New elements (with attributes in brackets)

  • headers h4, h5 and h6 : we previously supported h1 to h3 as synonyms for &lt:para style="hN"> we've added three more for HTML compatibility, along with sensible default styles.
  • cropMarks(borderWidth, markWidth, markColor, markLength) - this can be used to modify the default printers' crop marks which appear when docinit.useCropMarks is set
  • startIndex(name, offset, format) - we've added a new mechanism to generate indexes, as commonly seen in the backs of books and catalogues. These three tags work together. There is a good example of how to build an index in rlextra/examples/longdoc
  • index(name, item, offset, format)
  • showIndex(name, dot, style, tableStyle, headers)
  • onDraw(name, label) - this is a callback mechanism for advanced use, making it possible to respond to events while drawing paragraphs. It has been used for the index functionality, and can also

Other features

  • CSS3 color values are supported for our color attributes (rgb, rgba, hsl, hsla). This brings the new alpha functionality to RML.
  • We now have support for colour-separated PDF output. This is working in production for a major client, and is easy to use, but the API has not been "frozen" yet as we're taking advice on the best way to use it. If you have a use for this, please email us and we'll let you know what to do.

DIAGRA

  • New layout for the drawing editor window where you could see all panes easily.
  • Almost all attributes have help messages now.

PAGE CATCHER

  • Support for encrypted PDF files. If a file has been protected (e.g. with an owner password to lock against modification), you can now process the file if you supply the password
  • Support for modern versions of PDF file formats.

OPEN SOURCE - REPORTLAB TOOLKIT

Many new features have been added and numerous bugs have been fixed. A scan of the RML features above will give you an idea as most things have their counterpart in the open source package. Thanks to everybody who has contributed to the open-source toolkit in the run-up to the 2.4 release, whether by reporting bugs, sending patches, or contributing to the reportlab-users mailing list. Thanks especially to the following people: PJACock, Hans Brand, Ian Stevens, Yoann Roman, Randolph Bentson, Volker Haas, Simon King, Henning Vonbargen, Michael Egorov, Mike Folwell and Roberto Alsina.

Thanks also to the guys working on RTL support, which is on a branch for now, but will hopefully feature in the next one: Hosam Aly, Yoann Roman, Muayyad AlSadi.

If we missed you, please let us know!

NEW FEATURES

  • Reportlab 2.4 is installable with easy_install. You must have a compatible C compiler installed and the dependencies such as Freetype and PIL.

PDF

  • Canvas automatic cropmarks
  • RGB alpha colours - colours can now be transparent with an alpha value.
  • CMYK overPrint - physical colour mix in the printer - similar to RGB alpha but used in professional printing.
  • Colours module has a fade function that returns a list of different shades made up of one base colour.
  • Unicode font file names are now accepted
  • Lots of improvements and verbosity to error messages and the way they are handled.
  • Font size can now be specified in pixels

Platypus

  • Added support for styles h4-h6
  • Improved support for onDraw and SimpleIndex
  • Add support for index tableStyle
  • Added an alphabetic grouping indexing class
  • Added support for multi-level and alphabetical indexes
  • Added support for an unlimited number of TOC levels with default styles
  • Index entries can now be clickable.
  • You can colourise Python code if you have Pygments installed

Graphics

  • Chart axes values can be reversible.
  • Labels on the axes can now be drawn above or below the axes (hi or low).
  • A per swatch callout is now allowed in the legend.
  • A new anchoring mode for string 'numeric' that align numerical strings by their decimal place.
  • Drawing has a resized method now to change the size dynamically.

BUG FIXES

  • word counting in complex paragraphs has been fixed.
  • SimpleIndex and TableOfContents bugs have been fixed.
  • Fix for position of hyperlinks when crop marks are added.
  • flowables.py: fix special case of doctemplate with no frames
  • PDFFormXObject.format missing Resources bug patch from Scott Meyer
  • KeepInFrame justification bug has been fixed.
  • paragraph.py: fix linebreaking bug thanks to Roberto Alsina
  • Fix unicode/str issue bug found by Michael Egorov
  • YCategoryAxis makeTickLabels fix contributed by Mike Folwell
  • pdfdoc.py: fix wrong PDFDate contributed by Robert Alsina
  • and others ...