Changeset 252 for pkpgcounter/trunk/pkpgpdls/pdf.py
- Timestamp:
- 09/03/05 00:40:57 (19 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
pkpgcounter/trunk/pkpgpdls/pdf.py
r243 r252 47 47 ((self.firstblock[:128].find("\033%-12345X") != -1) and (self.firstblock.upper().find("LANGUAGE=PDF") != -1)) or \ 48 48 (self.firstblock.find("%PDF-") != -1) : 49 if self.debug : 50 sys.stderr.write("DEBUG: Input file is in the PDF format.\n") 49 self.logdebug("DEBUG: Input file is in the PDF format.") 51 50 return 1 52 51 else : … … 99 98 colorregexp = re.compile(r"(/ColorSpace) ?(/DeviceRGB|/DeviceCMYK)[/ \t\r\n]", re.I) 100 99 pagecount = 0 101 for obj ectin objects.values() :102 content = "".join(obj ect.content)100 for obj in objects.values() : 101 content = "".join(obj.content) 103 102 count = len(newpageregexp.findall(content)) 104 103 pagecount += count 105 104 if colorregexp.match(content) : 106 105 self.iscolor = 1 107 if self.debug : 108 sys.stderr.write("ColorSpace : %s\n" % content) 106 self.logdebug("ColorSpace : %s" % content) 109 107 return pagecount 110 108