[reportlab-users] SVG/EPS and ReportLab

Dinu Gherman gherman at darwin.in-berlin.de
Thu Jan 3 06:42:31 EST 2013


J. R. Carroll:


> After doing some research, I found, references, albeit OLD, that Reportlab doesn't play nice with SVG/EPS (by no fault of ReportLab) --- http://two.pairlist.net/pipermail/reportlab-users/2006-August/005247.html


Reportlab is free to sell importing PDFs as a great feature of their closed source branch. Quite a few people here did this in alternative, less accessible and less well documented ways.

Patrick Maupin:


> FWIW, this is the default approach taken by rst2pdf -- when presented with an SVG file, it will actually launch inkscape to create a PDF, then use the pdfrw library to read that PDF into Python structures that Reportlab can digest. An optional pure-python approach is also supported in rst2pdf, using the svg2rlg library, which is probably adequate for simple SVG files.


Right. If only rst2pdf would evolve more in sync with docutils... I remember some ancient code of mine, svglib (on which svg2rlg is based, I think) that I used to import SVG into reportlab-generated PDFs, for example with Matplotlib SVG output.

Two more thoughts. I think Matplotlib today could and should easily replace the reportlab.graphics.charts entirely, but at the time I worked on the reportlab charts it wasn't there, yet. And, Reportlab would add much more value to its code by implementing low-level PDF features still lacking right now in order to import/convert a fuller set of SVG, especially gradients and shading. It's a pitty to see this being ignored due to commercial decisions while the digital imaging world moves to vector formats as displays are becoming more retina-like.

Regards,

Dinu



More information about the reportlab-users mailing list