[reportlab-users] StringIO() in a SimpleDocTemplate
nassim.kammah at amd.com
Thu May 10 06:01:45 EDT 2007
I am really new to reportLab and having some trouble inserting images (
in StringIO buffers) into a SimpleDocTemplate.
The code I am trying to use looks like :
For the image generation :
canvas = FigureCanvasAgg(fig)
imageSize = canvas.get_width_height()
imageRgb = canvas.tostring_rgb()
pilImage = PIL.Image.fromstring("RGB", imageSize, imageRgb)
buffer = StringIO()
For the report part :
objects_to_draw = 
para = Paragraph("<b>My image</b>", normal)
But as you may guess, it is not working ...my guess is that my image as
a string is not a flowable. I read the chapter 9 on writing its own
flowable ( and the example of the hand) : is it the way to go, or is
there any other solution or something I missed?
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the reportlab-users