[reportlab-users] Insert a chart in a pdf...
Wed, 17 Jul 2002 19:18:42 +0100
In article <email@example.com>,
Marcus Vinicius Laranjeira <firstname.lastname@example.org> writes
>I have one doubt... I am inserting some charts in a pdf using a frame and
>some page templates,.... but the images seems to loose resolution when they
>are inserted in the flowable...
>I think that the process I am doing this is wrong:
>1- I create the pdf canvas and I add a frame on it
>2- I create the graphic in a drawing and render it as a png (I tryed with
>all kind of graphic type supported by pil)
>3- I add the graphic file to the frame... (sometimes I need to resize it so
>it can fit)
>Is there a way to insert the drawing directly on the frame flowable instead
>of creating a file and then inserting this file in the frame !?
>Thanks a lot,
You don't need to render to PNG to get the PDF framework to handle stuff
properly. You need just create the Drawing instance. Drawings are
themselves flowables so you can just append the drawing to the story in
the right place.