[reportlab-users] Insert a chart in a pdf...

Marcus Vinicius Laranjeira reportlab-users@reportlab.com
Wed, 17 Jul 2002 16:18:10 -0300


--=====================_27030637==.ALT
Content-Type: text/plain; charset="iso-8859-1"; format=flowed
Content-Transfer-Encoding: quoted-printable

Robin,

Nevermind... it worked fine !!!!

Thanks !

At 15:26 17/07/02 -0300, you wrote:
>Robin,
>
>I will try this... and, how about the size of the drawing !? if it does=20
>not 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=
=20
>> 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=20
>> it so
>> >it can fit)
>> >
>> >Is there a way to insert the drawing directly on the frame flowable=20
>> 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




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
--=====================_27030637==.ALT
Content-Type: text/html; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<html>
Robin,<br><br>
Nevermind... it worked fine !!!!<br><br>
Thanks !<br><br>
At 15:26 17/07/02 -0300, you wrote:<br>
<blockquote type=3Dcite class=3Dcite cite>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(&quot;someimage.jpg&quot;)<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
&lt;5.1.1.6.0.20020717145918.009fb010@imap.datacraft.com.br&gt;,<br>
Marcus Vinicius Laranjeira &lt;m.laranjeira@datacraft.com.br&gt;
writes<br>
&gt;<br>
&gt;<br>
&gt;All,<br>
&gt;<br>
&gt;I have one doubt... I am inserting some charts in a pdf using a frame
and <br>
&gt;some page templates,.... but the images seems to loose resolution
when they <br>
&gt;are inserted in the flowable...<br>
&gt;<br>
&gt;I think that the process I am doing this is wrong:<br>
&gt;<br>
&gt;1- I create the pdf canvas and I add a frame on it<br>
&gt;2- I create the graphic in a drawing and render it as a png (I tryed
with <br>
&gt;all kind of graphic type supported by pil)<br>
&gt;3- I add the graphic file to the frame... (sometimes I need to resize
it so <br>
&gt;it can fit)<br>
&gt;<br>
&gt;Is there a way to insert the drawing directly on the frame flowable
instead <br>
&gt;of creating a file and then inserting this file in the frame !?<br>
&gt;<br>
&gt;Thanks a lot,<br>
&gt;<br>
&gt;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><br>
<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> </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>

--=====================_27030637==.ALT--