call endPage of GFXOutputDev *before* flushing all text/polygon output
[swftools.git] / lib / pdf / BitmapOutputDev.cc
index ccf1da9..cedf06a 100644 (file)
@@ -552,6 +552,7 @@ void BitmapOutputDev::startPage(int pageNum, GfxState *state, double crop_x1, do
 void BitmapOutputDev::endPage()
 {
     msg("<verbose> endPage (BitmapOutputDev)");
+    gfxdev->endPage();
    
     if(layerstate == STATE_BITMAP_IS_ABOVE) {
        this->flushText();
@@ -568,7 +569,9 @@ void BitmapOutputDev::endPage()
     rgbdev->endPage();
     clip0dev->endPage();
     clip1dev->endPage();
-    gfxdev->endPage();
+
+    /* notice: we're not fully done yet with this page- there might still be 
+       a few calls to drawLink() yet to come */
 }
 
 GBool BitmapOutputDev::upsideDown()
@@ -1017,7 +1020,6 @@ void BitmapOutputDev::clip(GfxState *state)
 }
 void BitmapOutputDev::eoClip(GfxState *state)
 {
-    return;
     msg("<debug> eoClip");
     boolpolydev->eoClip(state);
     booltextdev->eoClip(state);
@@ -1269,8 +1271,15 @@ void BitmapOutputDev::beginTransparencyGroup(GfxState *state, double *bbox,
                                    GBool forSoftMask)
 {
     msg("<debug> beginTransparencyGroup");
+#if (xpdfMajorVersion*10000 + xpdfMinorVersion*100 + xpdfUpdateVersion) < 30207
+    GfxState*state1 = state->copy();
+    GfxState*state2 = state->copy();
+    state1->setPath(state->getPath()->copy());
+    state2->setPath(state->getPath()->copy());
+#else
     GfxState*state1 = state->copy(gTrue);
     GfxState*state2 = state->copy(gTrue);
+#endif
     boolpolydev->beginTransparencyGroup(state1, bbox, blendingColorSpace, isolated, knockout, forSoftMask);
     rgbdev->beginTransparencyGroup(state2, bbox, blendingColorSpace, isolated, knockout, forSoftMask);
     clip1dev->beginTransparencyGroup(state, bbox, blendingColorSpace, isolated, knockout, forSoftMask);
@@ -1280,8 +1289,15 @@ void BitmapOutputDev::beginTransparencyGroup(GfxState *state, double *bbox,
 void BitmapOutputDev::endTransparencyGroup(GfxState *state)
 {
     msg("<debug> endTransparencyGroup");
+#if (xpdfMajorVersion*10000 + xpdfMinorVersion*100 + xpdfUpdateVersion) < 30207
+    GfxState*state1 = state->copy();
+    GfxState*state2 = state->copy();
+    state1->setPath(state->getPath()->copy());
+    state2->setPath(state->getPath()->copy());
+#else
     GfxState*state1 = state->copy(gTrue);
     GfxState*state2 = state->copy(gTrue);
+#endif
     boolpolydev->endTransparencyGroup(state1);
     checkNewBitmap();
     rgbdev->endTransparencyGroup(state2);