Python PDF + Pictures

jeffself jeff.self at gmail.com
Tue Mar 11 11:44:34 EDT 2008


On Mar 11, 5:00 am, "durumd... at gmail.com" <durumd... at gmail.com> wrote:
> Hi, dear Python Masters!
>
> I wanna ask about the Python and PDF creating.
>
> I have many photos, and I wanna make some "presentation" from these
> photos, a "thumbnail" like document with one image per one page.
>
> If I wanna make one document now I do this:
> I execute a python script that create a html site with resized pictures,
> and split this html site to 50 images per one html file.
> Next I open these files in OpenOffice Writer by hand, and save them as
> PDF document with poor quality (image compression 95%, image DPI 75).
> This generates a medium sized PDF documents (2,5 - 5,6 MB for each) that
> can opened everywhere (because of PDF format).
>
> But I wanna automatize this process with python.
> The technic that I will use is this:
> 1.) Collect the files in dirs.
> 2.) I process one dir in one time.
> 3.) I get the files.
> 4.) I resize them to max. 1024/768.
> 5.) I put the actual image file to the PDF document.
> 6.) After each 50. file I open new numbered PDF.
> 7.) Every picture placed in one page, and every page orientation set up
> as the picture orientation (Portrait or Landscape).
>
> The PDF must be parameterized to image compression 95%, and 75 or 96 DPI.
>
> Do you knows about a PDF maker library with I can make this thing?
>
> Or other technic to simplify the making?
>
> Thanks for your help!
>    dd

You might also want to take a look at ReportLab.  Its a PDF library
for Python.  You can find it at http://www.reportlab.org/



More information about the Python-list mailing list