What's new in ReportLab 3.2

released on 2 June 2015

 

Changes to commercial package (rlextra/ReportLab PLUS)

  • Added a new attribute bulletAnchor for Para (and some other elements), as demonstrated below:
    (for further examples see RML sample 
    test_002_paras)

  •  Fix to for setting the background color in spans. For example, in this instance there is a heading that we want to set the backgound color but do not want it to extend to the full length of the frame, so  we set backcolor for span.

  • Improvements to includePdfPages.
    • New functionaility & new attributes cropping, pageSize and mediaBoxType.
      (for further examples, see RML sample test_016_pagecatcher)
    • Prior to this release, if you read a number of PDF files with includePdfPages and the function failed, it was not always clear which file was causing the problem. Error messages are now generated to name the file in which the exception occured. eg:
     IOError: (u'Cannot open resource "no-such-file.pdf"', "error storing u'no-such-file.pdf' in memory")
  • Changes to make the creation of long documents more straightforward.
    • added a name attribute for nextPage 
    • added new tags switchTemplate & nextPageIfNotEmpty.
    • (for further examples, see RML sample test_008_tables)
  • Changes to Figure and imageFigure elements, including adding captionAlign & captionPosition attributes.
Example: imageFigure with captionAlign="left"  Example: imageFigure with a para, captionPosition="top"
imageFigure_caption for rel notes 32 imageFigure_para for rel notes 32
  • Added new graphicsMode tag to insert graphics into a story.
  • Added attributes charSpace & support for mode in various string operations.
  • Add name attribute for nextPage and also new tags switchTemplate & nextPageIfNotEmpty
  • added MyExpandingText pluginFlowable which adjusts the font size to the maximun for the given space. See examples, RML sample test_008_tables)

Changes to open source code (reportlab)

  • Almost all of the above new features have the corresponding objects and attributes within our class hierarchy and may be used in the open source code. The exception is includePdfPages which is a commercial-only feature.   
  • Added proportional underlining specific to font sizes, set via the underlineProportion attribute of ParagraphStyles. Note how the thickness of the underlining in the left column increases in relation to the increase in font size:

    Proportional underlining set   Proportional underlining not set
     
  • TrueType fonts: added support for cmaps 10 & 13:
  • Allow the character spacing to be set for canvas.drawString and similar
  • DocTemplate class now supports a boolean displayDocTitle argument.
  • TableofContents now supports a formatter argument to allow formatting of the displayed page numbers (eg for appendices etc).
  • A number of other fixes. See the ReportLab Bitbucket repository for further details.

 

Note on version numbers

We follow Python's scheme with 3-point release numbers signifying major-minor-patch.  Generally, new features will result in an announced minor release such as "3.1" or "3.2".  In the last two months our focus has been on how well the packages install, so we went through a number of releases (3.1.1 up to 3.1.8) quietly with feedback from external clients. We will notify all registered users on the web site of significant releases.