Index: pkpgcounter/trunk/pkpgpdls/postscript.py
===================================================================
--- pkpgcounter/trunk/pkpgpdls/postscript.py (revision 272)
+++ pkpgcounter/trunk/pkpgpdls/postscript.py (revision 273)
@@ -71,4 +71,5 @@
         except OSError, msg :    
             raise pdlparser.PDLParserError, "Problem during analysis of Binary PostScript document : %s" % msg
+        self.logdebug("GhostScript said : %s pages" % pagecount)    
         return pagecount * self.copies
         
@@ -77,11 +78,11 @@
         self.infile.seek(0)
         pagecount = 0
-        pages = {}
-        pages[0] = { "copies" : 1 }
+        self.pages = { 0 : { "copies" : 1 } }
         oldpagenum = None
         previousline = ""
+        notrust = 0
         for line in self.infile.xreadlines() : 
-            if line.startswith(r"%%Creator: PScript5.dll") :
-                return 0 # Let this stuff be managed by GhostScript, since nup and copies disturb us.
+            if line.startswith(r"%%BeginResource: procset pdf") :
+                notrust = 1 # Let this stuff be managed by GhostScript, but we still extract number of copies
             elif line.startswith(r"%%Page: ") or line.startswith(r"(%%[Page: ") :
                 proceed = 1
@@ -97,5 +98,5 @@
                 if proceed :        
                     pagecount += 1
-                    pages[pagecount] = { "copies" : pages[pagecount-1]["copies"] }
+                    self.pages[pagecount] = { "copies" : self.pages[pagecount-1]["copies"] }
             elif line.startswith(r"%%Requirements: numcopies(") :    
                 try :
@@ -104,6 +105,6 @@
                     pass
                 else :    
-                    if number > pages[pagecount]["copies"] :
-                        pages[pagecount]["copies"] = number
+                    if number > self.pages[pagecount]["copies"] :
+                        self.pages[pagecount]["copies"] = number
             elif line.startswith(r"%%BeginNonPPDFeature: NumCopies ") :
                 # handle # of copies set by some Windows printer driver
@@ -113,6 +114,6 @@
                     pass
                 else :    
-                    if number > pages[pagecount]["copies"] :
-                        pages[pagecount]["copies"] = number
+                    if number > self.pages[pagecount]["copies"] :
+                        self.pages[pagecount]["copies"] = number
             elif line.startswith("1 dict dup /NumCopies ") :
                 # handle # of copies set by mozilla/kprinter
@@ -122,6 +123,6 @@
                     pass
                 else :    
-                    if number > pages[pagecount]["copies"] :
-                        pages[pagecount]["copies"] = number
+                    if number > self.pages[pagecount]["copies"] :
+                        self.pages[pagecount]["copies"] = number
             elif line.startswith("/languagelevel where{pop languagelevel}{1}ifelse 2 ge{1 dict dup/NumCopies") :
                 try :
@@ -130,18 +131,22 @@
                     pass
                 else :
-                    if number > pages[pagecount]["copies"] :
-                        pages[pagecount]["copies"] = number
+                    if number > self.pages[pagecount]["copies"] :
+                        self.pages[pagecount]["copies"] = number
             previousline = line
             
         # extract max number of copies to please the ghostscript parser, just    
         # in case we will use it later
-        self.copies = max([ v["copies"] for (k, v) in pages.items() ])
+        self.copies = max([ v["copies"] for (k, v) in self.pages.items() ])
         
         # now apply the number of copies to each page
         for pnum in range(1, pagecount + 1) :
-            page = pages.get(pnum, pages.get(1, { "copies" : 1 }))
+            page = self.pages.get(pnum, self.pages.get(1, { "copies" : 1 }))
             copies = page["copies"]
             pagecount += (copies - 1)
             self.logdebug("%s * page #%s" % (copies, pnum))
+        self.logdebug("Internal parser said : %s pages" % pagecount)
+        
+        if notrust :    
+            pagecount = 0 # Let gs do counting
         return pagecount
         
@@ -150,4 +155,5 @@
         self.copies = 1
         return self.natively() or self.throughGhostScript()
+            
         
 def test() :        
Index: pkpgcounter/trunk/pkpgpdls/version.py
===================================================================
--- pkpgcounter/trunk/pkpgpdls/version.py (revision 272)
+++ pkpgcounter/trunk/pkpgpdls/version.py (revision 273)
@@ -20,5 +20,5 @@
 #
 
-__version__ = "1.71"
+__version__ = "1.72"
 
 __doc__ = """pkpgcounter : a generic Page Description Languages parser."""
