Skip to content

What's New In Reportlab 3.5

released on 11/July/2018

Changes to ReportLabPLUS

Balanced columns example

Use the BalancedColumns class to make a flowable that splits its content flowables into two or more roughly equal sized columns. Effectively n frames are synthesized to take the content and the flowable tries to balance the content between them. The created frames will be split when the total height is too large and the split will maintain the balance.

Attributes - ncols, needed, spaceBefore, spaceAfter, showBoundary, leftPadding, innerPadding, rightPadding, topPadding, bottomPadding

    <para style="title">2 columns example</para>
    <balancedColumns ncols="2">
    <para style="normal"></para>

Samples show when ncols is 2, 3, 4


More examples source test_051_balancedcolumns.rml and output test_051_balancedcolumns.pdf

Hyphenation functionality (with Pyphen package installed)

If the pyphen python module is installed attribute hyphenationLang controls which language will be used to hyphenate words without explicit embedded hyphens.

If embeddedHyphenation is set then attempts will be made to split words with embedded hyphens. Attribute uriWasteReduce controls how we attempt to split long uri's. It is the fraction of a line that we regard as too much waste.

The default in module reportlab.rl_settings is 0.5 which means that we will try and split a word that looks like a uri if we would waste at least half of the line. Currently the hyphenation and uri splitting are turned off by default.

You need to modify the default settings by using the file ~/.rl_settings or adding a module to the python path.

Suitable values are: hyphenationLanguage='en_GB' embeddedHyphenation=1 uriWasteReduce=0.3

    `<para style="normal" hyphenationLang="lt_LT">Sed pretium sollicitudin lacinia. Maecenas eget neque sit amet urna commodo vehicula. Fusce sed felis a lorem <nobr>semper</nobr> luctus. Duis congue metus eget nulla gravida placerat. Praesent arcu libero, gravida vitae commodo at, pharetra et tellus. Suspendisse pulvinar nulla nec massa convallis scelerisque in sed lacus. Donec sed orci est, sed congue neque. In hac habitasse platea dictumst.</para>`

    `<nobr>semper</nobr>` prevents hyphenation

Example Image

Hypenation on long URLS, words with hyphens and words paragraphs with Image

RML code sample here source test_001_hello.rml and output test_001_hello.pdf

Other RML Fixes & Improvements

  • Add extra blockTable attributes emptyTableAction =(error|indicate|ignore) / minRowHeights
  • ParaStyle borderPadding allows tuple - borderPadding can be a singleton or (t,r) or (t,r,b) or (t,r,b,l) ie borderPadding=(5,20,10,5)
  • Added see examples here test_051_balancedcolumns.rml test_051_balancedcolumns.pdf
  • Added indexName attribute to getName & namedString
  • Added rml namedString new & discard attributes
  • added normalizeNameSpaces for csv data sources
  • Added direction to drawString methds to allow RTL
  • Added rml drawingGraphic tag
  • Added <setPageTopFlowables>
  • Allow for image anchorAtXY attribute
  • Push pageNumber into drawPdfImage
  • Fix unescapePDFText for python 3.x; bugf reported by Michael Trumm
  • svglib: <rect> as clippath definer; deferred clip-paths
  • Support controllable under/strike lines
  • Micro improvement in
  • CanvasAdapter allow for reverse attribute translation
  • Fix rml endDots parameter handling
  • Add svg boundary control in rml
  • Allow for inline svg and possible converting of svg
  • Fix td with both row and col span

Bug fixes

  • Fix lxml bug in svglib
  • Remove unwanted raise StopIteration statements (fully disallowed in 3.7)
  • Add pyodbc support to Datacharts; allow use of names everywhere for datasources
  • Fix bug in datamaker
  • Remove ascii, cmp & xrange builtins abuse
  • Reproducibility changes
  • Fix TT_Parse white space handling; improve reproducibility
  • Read file in binary mode to keep unix happy

Changes To Open Source Package (Reportlab)

This is a summary of changes made to the reportlab source code for each release. Please refer to subversion backlogs (using the release dates) for more details or for releases which we have not provide a higher level changes list for. E.g. to retrieve the changes made between release 3.4 and release 3.5, type::

$ hg log -r 54ce2469ba5c

The contributors lists are in no order and apologies to those accidentally not mentioned. If we missed you, please let us know!

RELEASE 3.5 07/07/2018

  • added SetPageTopFlowables flowable - This tag writes specified flowables first at the start of every page.
  • BalancedColumns flowable added - This splits content into evenly balanced columns within a frame width
  • primitive hyphenation functionality (with Pyphen installed) - allows hyphenation when words split
  • simple paragraphs now allow space shrinkage - Redcue the whitespace between words
  • mixed parallel / stacked barcharts mechanism - New chart types
  • makeStream compression fix for python 3.x
  • reproducibility fixes
  • Bugfix for KeepWithNext and None
  • Fix pie chart issue
  • allow canvas filename to be a wrapped OS level file
  • added DocTemplate._makeCanvas
  • _text2Path fix
  • AcroForm improvements
  • added anchorAtXY parameter for images - A
  • fix PDF syntax error with no Outlines
  • fix bullet code
  • qrencoder fix
  • table minRowHeights support
  • stopped abusing builtins to aid compatibility
  • fix embedded font & fontfinder bugs
  • fix zero width paragraph layout error
  • doughnut charts support innerRadiusFraction
  • more controllable under and strike lines