--- poppler-0.18.0-tile/poppler/PSOutputDev.cc- 2011-10-04 15:52:12.638773643 -0400 +++ poppler-0.18.0-tile/poppler/PSOutputDev.cc 2011-10-04 15:45:15.352617243 -0400 @@ -4040,10 +4040,13 @@ box.y2 = bbox[3]; gfx = new Gfx(xref, this, resDict, m_catalog, &box, NULL); writePS("/x {\n"); +#if 0 + /* setcachedevice locks the current color and doesn't work with PaintType 2 */ if (paintType == 2) { writePSFmt("{0:.6g} 0 {1:.6g} {2:.6g} {3:.6g} {4:.6g} setcachedevice\n", xStep, bbox[0], bbox[1], bbox[2], bbox[3]); } else +#endif { if (x1 - 1 <= x0) { writePS("1 0 setcharwidth\n"); @@ -4086,6 +4089,10 @@ state->getCTM(&ctm); ctm.invertTo(&ictm); writePSFmt("[{0:.6g} {1:.6g} {2:.6g} {3:.6g} {4:.6g} {5:.6g}] cm\n", ictm.m[0], ictm.m[1], ictm.m[2], ictm.m[3], ictm.m[4], ictm.m[5]); + if (paintType == 2) { + /* setpattern with PaintType 2 needs the paint color */ + writePS("currentcolor\n"); + } writePS("<<\n /PatternType 1\n"); writePSFmt(" /PaintType {0:d}\n", paintType); writePSFmt(" /TilingType {0:d}\n", tilingType);