Thread: PRS-500 pythonized PDFrasterFarian
View Single Post
Old 03-30-2007, 06:58 PM   #4
curiouser
Junior Member
curiouser began at the beginning.
 
Posts: 9
Karma: 10
Join Date: Jul 2006
The python script no longer needs anything from Windows. However, to get it working under Linux or OS X, a little bit of work needs to be put in. First of all, your Linux system must have the following installed:

- pdftk
- ImageMagick
- ghostscript
- pdftops (which is part of xpdf)

Luckily, all of the above are either part of a standard Linux install, or there should be packages available to install them.

Then, the python script need to be changed to fix the relevant paths. You're looking at stripping out the paths from the following lines (since the execs should be in your path):

gs_exec = "software\\gs\\gs8.54\\bin\\gswin32c.exe"
im = "software\\ImageMagick-6.3.1-Q8\\convert.exe"
(pin, pout) = os.popen2('software\\pdftk.exe "%s" dump_data' % (fil))
os.popen2('software\\pdftops.exe -f %d -l %d -eps -pagecrop "%s" prv_1.eps' % (pageNum, pageNum, fil))
(pin, pout) = os.popen2("software\\pdftk.exe %s dump_data" % (fil))

Plus, you'll have to make some change to the following line (I suspect you can set it equal to "", since ghostscript will be fully installed, and the items will be found):

gs_includes = '-I.\\software\\gs\\gs8.54\\lib -I.\\software\\gs\\gs8.54\\Resource -I.\\software\\gs\\fonts'

The last big thing you'll have to deal with is replacing the following:

os.popen2('software\\lrs2lrf\\lrs2lrf.exe "%s" "%s"' % (fil[:-4] + ".lrs", fil[:-4] + ".lrf"))

I'm not sure what the equivalent is on Linux, but I assume something is out there. Otherwise, you're probably looking at a conversion over to using the pylrs stuff put out by Falstaff (I've started playing with this, but there is a lot about LRS/LRF I don't understand yet).

Finally, you'll need a copy of modules/book_thumb.gif, which you can get from PDFrasterFarian.

I don't have a Linux system going right now, so I can't do this myself. Hopefully this provides enough of a roadmap.
curiouser is offline   Reply With Quote