[poppler] poppler/PreScanOutputDev.cc poppler/PreScanOutputDev.h poppler/PSOutputDev.cc

Albert Astals Cid aacid at kemper.freedesktop.org
Wed Feb 2 14:34:38 PST 2011


 poppler/PSOutputDev.cc      |    2 +-
 poppler/PreScanOutputDev.cc |    7 +++++++
 poppler/PreScanOutputDev.h  |    7 +++++++
 3 files changed, 15 insertions(+), 1 deletion(-)

New commits:
commit fe7b8aa4fc78aacf3226d019db74146ceaebd63c
Author: Albert Astals Cid <aacid at kde.org>
Date:   Wed Feb 2 22:35:40 2011 +0000

    Workaround bug when converting pdf to ps with level1
    
    See bug 31926 for more info

diff --git a/poppler/PSOutputDev.cc b/poppler/PSOutputDev.cc
index 4376722..7c7a29a 100644
--- a/poppler/PSOutputDev.cc
+++ b/poppler/PSOutputDev.cc
@@ -2977,7 +2977,7 @@ GBool PSOutputDev::checkPageSlice(Page *page, double /*hDPI*/, double /*vDPI*/,
     page->displaySlice(scan, 72, 72, rotateA, useMediaBox, crop,
                      sliceX, sliceY, sliceW, sliceH,
                      printing, catalog, abortCheckCbk, abortCheckCbkData);
-    rasterize = scan->usesTransparency();
+    rasterize = scan->usesTransparency() || scan->hasLevel1PSBug();
     delete scan;
   } else {
     rasterize = gTrue;
diff --git a/poppler/PreScanOutputDev.cc b/poppler/PreScanOutputDev.cc
index 5e6d5a7..8ccdfe6 100644
--- a/poppler/PreScanOutputDev.cc
+++ b/poppler/PreScanOutputDev.cc
@@ -15,6 +15,7 @@
 //
 // Copyright (C) 2009 Carlos Garcia Campos <carlosgc at gnome.org>
 // Copyright (C) 2010 Albert Astals Cid <aacid at kde.org>
+// Copyright (C) 2011 William Bader <williambader at hotmail.com>
 //
 // To see a description of the changes please see the Changelog file that
 // came with your tarball or type make ChangeLog if you are building from git
@@ -36,6 +37,7 @@
 //------------------------------------------------------------------------
 
 PreScanOutputDev::PreScanOutputDev() {
+  level = globalParams->getPSLevel();
   clearStats();
 }
 
@@ -141,6 +143,10 @@ void PreScanOutputDev::drawImageMask(GfxState *state, Object * /*ref*/, Stream *
   check(state->getFillColorSpace(), state->getFillColor(),
 	state->getFillOpacity(), state->getBlendMode());
   gdi = gFalse;
+  if ((level == psLevel1 || level == psLevel1Sep) &&
+      state->getFillColorSpace()->getMode() == csPattern) {
+    level1PSBug = gTrue;
+  }
 
   if (inlineImg) {
     str->reset();
@@ -281,4 +287,5 @@ void PreScanOutputDev::clearStats() {
   gray = gTrue;
   transparency = gFalse;
   gdi = gTrue;
+  level1PSBug = gFalse;
 }
diff --git a/poppler/PreScanOutputDev.h b/poppler/PreScanOutputDev.h
index 6af7a1e..f09ecca 100644
--- a/poppler/PreScanOutputDev.h
+++ b/poppler/PreScanOutputDev.h
@@ -15,6 +15,7 @@
 //
 // Copyright (C) 2009 Carlos Garcia Campos <carlosgc at gnome.org>
 // Copyright (C) 2010 Albert Astals Cid <aacid at kde.org>
+// Copyright (C) 2011 William Bader <williambader at hotmail.com>
 //
 // To see a description of the changes please see the Changelog file that
 // came with your tarball or type make ChangeLog if you are building from git
@@ -132,6 +133,10 @@ public:
   // clearStats() are all rasterizable by GDI calls in GDIOutputDev.
   GBool isAllGDI() { return gdi; }
 
+  // Returns true if the operations performed since the last call to
+  // clearStats() processed a feature that PSOutputDev does not implement.
+  GBool hasLevel1PSBug() { return level1PSBug; }
+
   // Clear the stats used by the above functions.
   void clearStats();
 
@@ -144,6 +149,8 @@ private:
   GBool gray;
   GBool transparency;
   GBool gdi;
+  PSLevel level;		// PostScript level (1, 2, separation)
+  GBool level1PSBug;		// gTrue if it uses a feature not supported in PSOutputDev
 };
 
 #endif


More information about the poppler mailing list