Python PDF + Pictures

D

durumdara

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
 
B

Bruno Desthuilliers

(e-mail address removed) a écrit :
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?

Dont know if this will match your needs, but you may want to have a look
at pisa:
http://www.htmltopdf.org/
 
S

Stefan Behnel

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.

PIL can write PDFs, and it's clearly a good choice for image processing.

http://www.pythonware.com/products/pil/

Stefan
 
D

durumdara

Hi!

Bruno said:
(e-mail address removed) a écrit :
Dont know if this will match your needs, but you may want to have a look
at pisa:
http://www.htmltopdf.org/

With HTML I have only one problem.
The HTML is not page specific language.
But I wanna use pages (for example: A4) with diff. orientation to show
images correctly.

But I try it if possible.

Thanks for your help:
dd
 
J

jeffself

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/
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,236
Members
46,821
Latest member
AleidaSchi

Latest Threads

Top