[reportlab-users] Insert a chart in a pdf...
Marcus Vinicius Laranjeira
reportlab-users@reportlab.com
Wed, 17 Jul 2002 15:26:34 -0300
--=====================_23934102==.ALT
Content-Type: text/plain; charset="iso-8859-1"; format=flowed
Content-Transfer-Encoding: quoted-printable
Robin,
I will try this... and, how about the size of the drawing !? if it does not=
=20
fit the space I have, how do I scale it down !? with an image I can do=20
something like this:
.
.
.
img =3D Image("someimage.jpg")
img.drawHeight =3D 300
img.drawWidth =3D 300
story.append(img)
.
.
.
But how about raw drawings !?
Thanks,
Marcus
At 19:18 17/07/02 +0100, Robin Becker wrote:
>In article <5.1.1.6.0.20020717145918.009fb010@imap.datacraft.com.br>,
>Marcus Vinicius Laranjeira <m.laranjeira@datacraft.com.br> writes
> >
> >
> >All,
> >
> >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,
> >
> >Marcus
>.......
>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.
>--
>Robin Becker
>_______________________________________________
>reportlab-users mailing list
>reportlab-users@reportlab.com
>http://two.pairlist.net/mailman/listinfo/reportlab-users
Marcus Vinicius Laranjeira
MON Center
Datacraft do Brasil - (http://www.datacraft.com.br)
R. Tenente Negr=E3o, 140 - 8o. Andar
Itaim Bibi - S=E3o Paulo - SP - 04530-030
Tel: +55-11-3053-0241
Fax: +55-11-3053-0220
--=====================_23934102==.ALT
Content-Type: text/html; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<html>
Robin,<br><br>
I will try this... and, how about the size of the drawing !? if it does
not fit the space I have, how do I scale it down !? with an image I can
do something like this:<br>
.<br>
.<br>
.<br>
img =3D Image("someimage.jpg")<br>
img.drawHeight =3D 300<br>
img.drawWidth =3D 300<br>
story.append(img)<br>
.<br>
.<br>
.<br><br>
But how about raw drawings !?<br><br>
Thanks,<br><br>
Marcus<br><br>
<br>
At 19:18 17/07/02 +0100, Robin Becker wrote:<br>
<blockquote type=3Dcite class=3Dcite cite>In article
<5.1.1.6.0.20020717145918.009fb010@imap.datacraft.com.br>,<br>
Marcus Vinicius Laranjeira <m.laranjeira@datacraft.com.br>
writes<br>
><br>
><br>
>All,<br>
><br>
>I have one doubt... I am inserting some charts in a pdf using a frame
and <br>
>some page templates,.... but the images seems to loose resolution
when they <br>
>are inserted in the flowable...<br>
><br>
>I think that the process I am doing this is wrong:<br>
><br>
>1- I create the pdf canvas and I add a frame on it<br>
>2- I create the graphic in a drawing and render it as a png (I tryed
with <br>
>all kind of graphic type supported by pil)<br>
>3- I add the graphic file to the frame... (sometimes I need to resize
it so <br>
>it can fit)<br>
><br>
>Is there a way to insert the drawing directly on the frame flowable
instead <br>
>of creating a file and then inserting this file in the frame !?<br>
><br>
>Thanks a lot,<br>
><br>
>Marcus<br>
.......<br>
You don't need to render to PNG to get the PDF framework to handle
stuff<br>
properly. You need just create the Drawing instance. Drawings are<br>
themselves flowables so you can just append the drawing to the story
in<br>
the right place.<br>
-- <br>
Robin Becker<br>
_______________________________________________<br>
reportlab-users mailing list<br>
reportlab-users@reportlab.com<br>
<a href=3D"http://two.pairlist.net/mailman/listinfo/reportlab-users"=
eudora=3D"autourl">http://two.pairlist.net/mailman/listinfo/reportlab-users=
</a></blockquote>
<x-sigsep><p></x-sigsep>
<font face=3D"Courier New, Courier"><br><br>
<br>
Marcus Vinicius Laranjeira<br>
MON Center <br><br>
Datacraft do Brasil -
(<a href=3D"http://www.datacraft.com.br/" eudora=3D"autourl">http://www.data=
craft.com.br</a>)
<br>
R. Tenente Negr=E3o, 140 - 8o. Andar <br>
Itaim Bibi - S=E3o Paulo - SP - 04530-030 <br>
Tel: +55-11-3053-0241<br>
Fax: +55-11-3053-0220</font></html>
--=====================_23934102==.ALT--