diff options
author | Albert Astals Cid <aacid@kde.org> | 2011-02-02 22:35:40 +0000 |
---|---|---|
committer | Albert Astals Cid <aacid@kde.org> | 2011-02-02 22:38:36 +0000 |
commit | 87b67832c0ad6435d6d1f45cff860b3c1ae15a48 (patch) | |
tree | be4388b743c16e5ec29e28bb7f8510e5196cbcf3 | |
parent | 87d47e5cd7306d96f4e99e458f3947933e274140 (diff) |
Workaround bug when converting pdf to ps with level1
See bug 31926 for more info
-rw-r--r-- | poppler/PSOutputDev.cc | 2 | ||||
-rw-r--r-- | poppler/PreScanOutputDev.cc | 7 | ||||
-rw-r--r-- | poppler/PreScanOutputDev.h | 7 |
3 files changed, 15 insertions, 1 deletions
diff --git a/poppler/PSOutputDev.cc b/poppler/PSOutputDev.cc index 43767229..7c7a29ad 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 5e6d5a73..8ccdfe6a 100644 --- a/poppler/PreScanOutputDev.cc +++ b/poppler/PreScanOutputDev.cc @@ -15,6 +15,7 @@ // // Copyright (C) 2009 Carlos Garcia Campos <carlosgc@gnome.org> // Copyright (C) 2010 Albert Astals Cid <aacid@kde.org> +// Copyright (C) 2011 William Bader <williambader@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 6af7a1eb..f09ecca9 100644 --- a/poppler/PreScanOutputDev.h +++ b/poppler/PreScanOutputDev.h @@ -15,6 +15,7 @@ // // Copyright (C) 2009 Carlos Garcia Campos <carlosgc@gnome.org> // Copyright (C) 2010 Albert Astals Cid <aacid@kde.org> +// Copyright (C) 2011 William Bader <williambader@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 |