Thread: PRS-500 pythonized PDFrasterFarian
View Single Post
Old 03-29-2007, 05:48 PM   #1
curiouser
Junior Member
curiouser began at the beginning.
 
Posts: 9
Karma: 10
Join Date: Jul 2006
pythonized PDFrasterFarian

In the interest of advancing the cross-platform development of alex_d's work, I present a reasonable translation over to python. It's not feature complete with the current PDFrasterFarian, but as is, it should give you nice full page PDF conversions. Plus, I've tossed in some new features. I might have waited a little longer to toss this out, but the resulting output from Google Books PDFs is a big improvement, which I thought would interest some.

Also, the Windows-specific dependencies are pretty much gone. It should not be too hard to go from this point to Linux and Mac versions, as well as automate its use as CGI, etc.

Improvements:
- properly centers content
- does nice trimming of PDFs produced from scans (like ones from Google Books - try it out!)
- monochrome output option for smaller (though a bit less legible) PDFs
- eliminates use of AutoImager (using PIL - no speed penalty)

Missing:
- various orientation settings (splitting into 1/2 and 1/4 pages)
- not using temp dir for scratch work
- changing title & author fields

To Do:
- add proper hookup of command line args
- eliminate dependency on pdftk - should be able to digest the PDF in python
- add a little more control for cropping

Installation:
1) install PDFrasterFarian
2) install python
3) install PIL (http://www.pythonware.com/products/pil/)
4) unzip the attached pyprf.zip into same directory

Usage:
python pyprf.py foo.pdf
(sorry, but if you want to tweak processing options, you'll have to tweak the python code)

Enjoy!

P.S> I just noticed the title and author are hardcoded - sorry!
Attached Files
File Type: zip pyprf.zip (4.7 KB, 722 views)

Last edited by curiouser; 03-29-2007 at 05:55 PM.
curiouser is offline   Reply With Quote