[Baypiggies] Adding gif's to a PDF

Tony Cappellini cappy2112 at gmail.com
Sun Feb 21 02:11:41 CET 2010


Michael,

It worked perfectly, verbatim.
Not knowing anything about the structure of PDFs, I was envisioning I would
need to tweak each image, but the PDF came out exactly
as I was expecting!

Many thanks

On Sat, Feb 20, 2010 at 8:04 AM, Michiel Overtoom <motoom at xs4all.nl> wrote:

> On 2010-02-20 06:10, Tony Cappellini wrote:
>
>  Does anyone have an example of how to write images to a PDF file?
>>
>
> from reportlab.pdfgen import canvas
> import glob
> c = canvas.Canvas("book.pdf")
> for fn in glob.glob("*.gif"):
>    dim = c.drawImage(fn,0,0)
>    c.setPageSize(dim)
>    c.showPage()
> c.save()
>
>
>
> Greetings,
>
> --
> "The ability of the OSS process to collect and harness
> the collective IQ of thousands of individuals across
> the Internet is simply amazing." - Vinod Valloppillil
> http://www.catb.org/~esr/halloween/halloween4.html<http://www.catb.org/%7Eesr/halloween/halloween4.html>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/baypiggies/attachments/20100220/7738cdc7/attachment.html>


More information about the Baypiggies mailing list