Changeset 527 for pkpgcounter/trunk/pkpgpdls/postscript.py
- Timestamp:
- 11/28/07 18:28:30 (17 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
pkpgcounter/trunk/pkpgpdls/postscript.py
r522 r527 25 25 import sys 26 26 import os 27 import tempfile28 import popen229 27 30 28 import pdlparser … … 34 32 """A parser for PostScript documents.""" 35 33 totiffcommands = [ 'gs -sDEVICE=tiff24nc -dPARANOIDSAFER -dNOPAUSE -dBATCH -dQUIET -r"%(dpi)i" -sOutputFile="%(outfname)s" "%(infname)s"' ] 34 required = [ "gs" ] 36 35 openmode = "rU" 37 36 def isValid(self) : … … 53 52 """Get the count through GhostScript, useful for non-DSC compliant PS files.""" 54 53 self.logdebug("Internal parser sucks, using GhostScript instead...") 54 if self.isMissing(self.required) : 55 raise pdlparser.PDLParserError, "The gs interpreter is nowhere to be found in your PATH (%s)" % os.environ.get("PATH", "") 55 56 infname = self.filename 56 57 command = 'gs -sDEVICE=bbox -dPARANOIDSAFER -dNOPAUSE -dBATCH -dQUIET "%(infname)s" 2>&1 | grep -c "%%HiResBoundingBox:" 2>/dev/null'