Hi, so bug 30107 describes a PDF in which PSOutputDev thinks it has to raster 
instead of converting to PS.

This happens because PreScanOutputDev says "transparency" even if all the PDF 
has is a transparency group with alpha value set to 1 (which is basically 
opaque).

I've created the following patch that is a bit less agressive with the 
transparency flag.

I've passed it over my regression test suite and seems to give improvements 
and no other problem.

Anyone against me commiting it next thursday?

Thanks,
  Albert
diff --git a/poppler/PreScanOutputDev.cc b/poppler/PreScanOutputDev.cc
index 7c3f522..bdbcf7a 100644
--- a/poppler/PreScanOutputDev.cc
+++ b/poppler/PreScanOutputDev.cc
@@ -235,10 +235,21 @@ void PreScanOutputDev::beginTransparencyGroup(
 			   GfxColorSpace * /*blendingColorSpace*/,
 			   GBool /*isolated*/, GBool /*knockout*/,
 			   GBool /*forSoftMask*/) {
-  transparency = gTrue;
   gdi = gFalse;
 }
 
+void PreScanOutputDev::paintTransparencyGroup(GfxState *state, double * /*bbox*/)
+{
+  check(state->getFillColorSpace(), state->getFillColor(),
+        state->getFillOpacity(), state->getBlendMode());
+}
+
+void PreScanOutputDev::setSoftMask(GfxState * /*state*/, double * /*bbox*/, GBool /*alpha*/,
+			   Function * /*transferFunc*/, GfxColor * /*backdropColor*/)
+{
+  transparency = gTrue;
+}
+
 void PreScanOutputDev::check(GfxColorSpace *colorSpace, GfxColor *color,
 			     double opacity, GfxBlendMode blendMode) {
   GfxRGB rgb;
diff --git a/poppler/PreScanOutputDev.h b/poppler/PreScanOutputDev.h
index 39c7819..552ec65 100644
--- a/poppler/PreScanOutputDev.h
+++ b/poppler/PreScanOutputDev.h
@@ -109,6 +109,9 @@ public:
 				      GfxColorSpace *blendingColorSpace,
 				      GBool isolated, GBool knockout,
 				      GBool forSoftMask);
+	virtual void paintTransparencyGroup(GfxState *state, double *bbox);
+	virtual void setSoftMask(GfxState *state, double *bbox, GBool alpha,
+			   Function *transferFunc, GfxColor *backdropColor);
 
   //----- special access
 
_______________________________________________
poppler mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/poppler

Reply via email to