[reportlab-users] Generating PNGs/JPGs instead of PDFs?
    Carl Karsten 
    carl at personnelware.com
       
    Wed Dec 31 21:09:59 EST 2008
    
    
  
Erik Wickstrom wrote:
> Hi all,
> 
> First, Happy New Year!
> 
> I need to output some reports as PNGs or JPGs in addition to PDFs.  Can
> ReportLab render to these other formats? 
Last I checked, no.
> If not, any suggestions on how I
> can do this?
I have been fighting this for about 2 years.
use reportlab to generate the pdf, then convert that to an image.  it's easy to 
do at the command prompt, but trying to do it reliably in python gets tedious.
PythonMagickWand is python bindings for ImageMagick.
http://www.procoders.net/?p=121
last year's version caused segfaults, so I went with shelling out to 
ghostscript: look at line 42 badge_png(ds):
http://bazaar.launchpad.net/~carl-personnelware/web2conf/badges/annotate/head%3A/controllers/badge.py
then look at line 82 def badge_png2(ds).  that would be really nice if it wasn't 
  for
https://bugs.edge.launchpad.net/poppler-python/+bug/312462
TypeError: document_new_from_data() argument 1 must be string without null 
bytes, not str
Carl K
    
    
More information about the reportlab-users
mailing list