[Baypiggies] Adding gif's to a PDF

Tony Cappellini cappy2112 at gmail.com
Sat Feb 20 17:21:36 CET 2010


Thanks Michael.
Since I've posted my message, I've found 3 python libraries for writing PDF
files, but their documentation
doesn't state anything regarding "adding images".


I'll try your code.

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/9b756b50/attachment.htm>


More information about the Baypiggies mailing list