View Single Post
Old 04-03-2007, 11:24 PM   #27
ashkulz
Addict
ashkulz will become famous soon enoughashkulz will become famous soon enoughashkulz will become famous soon enoughashkulz will become famous soon enoughashkulz will become famous soon enoughashkulz will become famous soon enoughashkulz will become famous soon enough
 
ashkulz's Avatar
 
Posts: 350
Karma: 705
Join Date: Dec 2006
Location: Mumbai, India
Device: Kindle 1/REB 1200
Quote:
Originally Posted by sammykrupa
Unable to determine total number of pages in PDF
Please enter total page count: 3

Temporary directory: /tmp/pdfread-oDxOLM

Page 1/3: EXTRACT RASTERIZE BLANK
Page 2/3: EXTRACT RASTERIZE BLANK
Page 3/3: EXTRACT RASTERIZE BLANK
Traceback (most recent call last):
File "/Users/mikekrup/Desktop/pdfread-v4-src/src/pdfread.py", line 515, in ?
PdfConverter().main()
File "/Users/mikekrup/Desktop/pdfread-v4-src/src/pdfread.py", line 338, in main
delete = self.FORMATS[self.options.format](self)
File "/Users/mikekrup/Desktop/pdfread-v4-src/src/pdfread.py", line 279, in generate_lrf
from pylrs.pylrs import Book, PageStyle, BlockStyle, ImageStream, BlockSpace, ImageBlock
File "/Users/mikekrup/Desktop/pdfread-v4-src/src/pylrs/pylrs.py", line 11
from elementtree.ElementTree import (Element, SubElement)
^
SyntaxError: invalid syntax
Okay, there some to be two errors here:
  • All the PDF pages were detected as blank. This is not normal, as that means GhostScript did not produce the PNG file. Go to the temporary directory mentioned, and see if any png images are present. If not, change line 122 and add "print " before exec_cmd and paste the output here. The code should look like:
    Code:
    print exec_cmd('gs', '-q', ...
  • You also need the elementtree module (this is included in python 2.5) -- download the ElementTree library, extract it and copy the folder 'elementtree' to the same location as pdfread.py

BTW, once you get it working, could you post the steps you took to install everything? I'm sure it would be of interest to other people who use OS X.
ashkulz is offline   Reply With Quote