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 ?
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:
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.