Re: Reportlab + SVG
Andy Robinson <[email protected]>
| Newsgroups | gmane.comp.python.reportlab.user |
|---|---|
| Message-ID | <CABjtApsH_-DXgGF2=FmsuGPyJ0DUuLER1cLaFD9KXpiuEcaGfg@mail.gmail.com> |
I can confirm that we have nothing other than Dinu's approach in the open source world. It works very well though, handling the well-known Postscript tiger image. If your image has a lot of text, it may make sense to use a design package to convert your fonts to curves. PIL does not handle these as proper vectors AFAIK. ReportLab PLUS can handle PDF artwork natively so if you want to consider the commercial route, you can turn SVG into PDF (using various XPDF or Ghostscript tools) and just use them with all of our image tags. - Andy On 31 March 2014 07:09, Dinu Gherman <[email protected]> wrote: > Richard Shea: > >> It's a long time since I looked at this subject so I thought I would ask >> for an update. >> >> If I have an SVG file I wish to embed in a Reportlab generated PDF is >> the recommended approach to use PIL (or Pillow ?) to convert it to a >> non-vector format and use the result of the process to initialise a >> Reportlab Image object ? >> >> I'm asking because I thought sometime I read about a more direct >> approach where ReportLab might deal with SVG's directly but now I go and >> look for a reference to that idea I can't find it. > > You might want to look at this: > > https://pypi.python.org/pypi/svglib/0.6.3 > > It's somewhat dusted, not Python 3.0, and comes with a few limitations, mostly given by SVG features not mappable to ReportLab Graphics features, like gradiation, some font magic and probably a few others... > > Regards, > > Dinu > > _______________________________________________ > reportlab-users mailing list > [email protected] > http://two.pairlist.net/mailman/listinfo/reportlab-users -- Andy Robinson Managing Director ReportLab Europe Ltd. Thornton House, Thornton Road, Wimbledon, London SW19 4NG, UK Tel +44-20-8405-6420