From: kramm Date: Wed, 14 May 2008 06:47:24 +0000 (+0000) Subject: added new function finishPage(), to be called after links are processed X-Git-Tag: buttons-working~206 X-Git-Url: http://git.asbjorn.biz/?p=swftools.git;a=commitdiff_plain;h=bb51f4b9fa144d46ff9ff32e8c9d818ae4e97153 added new function finishPage(), to be called after links are processed --- diff --git a/lib/pdf/BitmapOutputDev.cc b/lib/pdf/BitmapOutputDev.cc index e551fd6..c9cbd0c 100644 --- a/lib/pdf/BitmapOutputDev.cc +++ b/lib/pdf/BitmapOutputDev.cc @@ -552,6 +552,13 @@ void BitmapOutputDev::startPage(int pageNum, GfxState *state, double crop_x1, do void BitmapOutputDev::endPage() { msg(" endPage (BitmapOutputDev)"); + + /* notice: we're not fully done yet with this page- there might still be + a few calls to drawLink() yet to come */ +} +void BitmapOutputDev::finishPage() +{ + msg(" finishPage (BitmapOutputDev)"); gfxdev->endPage(); if(layerstate == STATE_BITMAP_IS_ABOVE) { @@ -569,9 +576,6 @@ void BitmapOutputDev::endPage() rgbdev->endPage(); clip0dev->endPage(); clip1dev->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() diff --git a/lib/pdf/BitmapOutputDev.h b/lib/pdf/BitmapOutputDev.h index 67c1c59..3adf11a 100644 --- a/lib/pdf/BitmapOutputDev.h +++ b/lib/pdf/BitmapOutputDev.h @@ -72,6 +72,7 @@ public: virtual void startPage(int pageNum, GfxState *state, double x1,double y1,double x2,double y2); virtual void endPage(); + virtual void finishPage(); virtual void saveState(GfxState *state); virtual void restoreState(GfxState *state); diff --git a/lib/pdf/CommonOutputDev.h b/lib/pdf/CommonOutputDev.h index 746bc71..9a024c1 100644 --- a/lib/pdf/CommonOutputDev.h +++ b/lib/pdf/CommonOutputDev.h @@ -37,5 +37,6 @@ class CommonOutputDev: public OutputDev virtual void setParameter(const char*key, const char*value) = 0; virtual void preparePage(int pdfpage, int outputpage) = 0; + virtual void finishPage() {}; }; #endif //__deviceinterface_h__ diff --git a/lib/pdf/pdf.cc b/lib/pdf/pdf.cc index 2579978..a5b2607 100644 --- a/lib/pdf/pdf.cc +++ b/lib/pdf/pdf.cc @@ -108,6 +108,8 @@ void render2(gfxpage_t*page, gfxdevice_t*dev) } pi->doc->displayPage((OutputDev*)pi->outputDev, page->nr, zoom*multiply, zoom*multiply, /*rotate*/0, true, true, /*doLinks*/(int)1); pi->doc->processLinks((OutputDev*)pi->outputDev, page->nr); + pi->outputDev->finishPage(); + pi->outputDev->setDevice(0); if(pi->middev) { gfxdevice_rescale_setdevice(pi->middev, 0x00000000);