Changeset 1673
- Timestamp:
- 08/09/04 20:14:22 (20 years ago)
- Location:
- pykota/trunk
- Files:
-
- 2 modified
Legend:
- Unmodified
- Added
- Removed
-
pykota/trunk/NEWS
r1671 r1673 24 24 - 1.20alpha1 : 25 25 26 - Added workaround for number of copies directly set in 27 PostScript code. 28 26 29 - Added german translation. 27 30 -
pykota/trunk/pykota/pdlanalyzer.py
r1622 r1673 22 22 # 23 23 # $Log$ 24 # Revision 1.27 2004/08/09 18:14:22 jalet 25 # Added workaround for number of copies and some PostScript drivers 26 # 24 27 # Revision 1.26 2004/07/22 13:49:51 jalet 25 28 # Added support for binary PostScript through GhostScript if native DSC … … 131 134 """Initialize PostScript Analyzer.""" 132 135 self.infile = infile 136 self.copies = 1 133 137 134 138 def throughGhostScript(self) : … … 158 162 except OSError, msg : 159 163 raise PDLAnalyzerError, "Problem during analysis of Binary PostScript document." 160 return pagecount 164 return pagecount * self.copies 161 165 162 166 def natively(self) : … … 167 171 if line.startswith("%%Page: ") : 168 172 pagecount += 1 169 return pagecount 173 elif line.startswith("%%BeginNonPPDFeature: NumCopies ") : 174 # handle # of copies set by some Windows printer driver 175 try : 176 number = int(line.strip().split()[2]) 177 except : 178 pass 179 else : 180 if number > 1 : 181 self.copies = number 182 elif line.startswith("1 dict dup /NumCopies ") : 183 # handle # of copies set by mozilla/kprinter 184 try : 185 number = int(line.strip().split()[4]) 186 except : 187 pass 188 else : 189 if number > 1 : 190 self.copies = number 191 return pagecount * self.copies 170 192 171 193 def getJobSize(self) :