]> git.pld-linux.org Git - packages/swftools.git/commitdiff
- updated to 0.9.2 auto/th/swftools-0.9.2-1
authorJakub Bogusz <qboosh@pld-linux.org>
Sat, 21 Jun 2014 16:47:07 +0000 (18:47 +0200)
committerJakub Bogusz <qboosh@pld-linux.org>
Sat, 21 Jun 2014 16:47:07 +0000 (18:47 +0200)
- added giflib patch (update for giflib 5.1+)
- added poppler patches (one from some external repository, the second self made),
  use system poppler library instead of outdated, vulnerable xpdf sources
- added install patch (make install fix)

swftools-giflib.patch [new file with mode: 0644]
swftools-install.patch [new file with mode: 0644]
swftools-poppler.patch [new file with mode: 0644]
swftools-poppler2.patch [new file with mode: 0644]
swftools.spec

diff --git a/swftools-giflib.patch b/swftools-giflib.patch
new file mode 100644 (file)
index 0000000..8838f11
--- /dev/null
@@ -0,0 +1,54 @@
+--- swftools-0.9.2/src/gif2swf.c.orig  2011-01-02 04:30:29.000000000 +0100
++++ swftools-0.9.2/src/gif2swf.c       2014-06-19 21:18:02.578953540 +0200
+@@ -230,13 +230,13 @@
+     }
+     fclose(fi);
+-    if ((gft = DGifOpenFileName(sname)) == NULL) {
++    if ((gft = DGifOpenFileName(sname, NULL)) == NULL) {
+         fprintf(stderr, "%s is not a GIF file!\n", sname);
+         return t;
+     }
+     if (DGifSlurp(gft) != GIF_OK) {
+-        PrintGifError();
++        fprintf(stderr, "GIF-LIB error: %s\n", GifErrorString(gft->Error));
+         return t;
+     }
+@@ -455,7 +455,7 @@
+     free(pal);
+     free(imagedata);
+-    DGifCloseFile(gft);
++    DGifCloseFile(gft, NULL);
+     return t;
+ }
+@@ -488,7 +488,7 @@
+     }
+     fclose(fi);
+-    if ((gft = DGifOpenFileName(s)) == NULL) {
++    if ((gft = DGifOpenFileName(s, NULL)) == NULL) {
+         fprintf(stderr, "%s is not a GIF file!\n", fname);
+         return -1;
+     }
+@@ -499,7 +499,7 @@
+         global.max_image_height = gft->SHeight;
+     if (DGifSlurp(gft) != GIF_OK) { 
+-        PrintGifError();
++        fprintf(stderr, "GIF-LIB error: %s\n", GifErrorString(gft->Error));
+         return -1;
+     }
+     // After DGifSlurp() call, gft->ImageCount become available
+@@ -518,7 +518,7 @@
+             fprintf(stderr, "frame: %u, delay: %.3f sec\n", i + 1, getGifDelayTime(gft, i) / 100.0);
+     }
+-    DGifCloseFile(gft);
++    DGifCloseFile(gft, NULL);
+     return 0;
+ }
diff --git a/swftools-install.patch b/swftools-install.patch
new file mode 100644 (file)
index 0000000..b015eec
--- /dev/null
@@ -0,0 +1,16 @@
+--- swftools-0.9.2/swfs/Makefile.in.orig       2012-04-08 19:25:26.000000000 +0200
++++ swftools-0.9.2/swfs/Makefile.in    2014-06-21 17:55:24.215605265 +0200
+@@ -41,9 +41,9 @@
+       $(INSTALL_DATA) ./PreLoaderTemplate.swf $(pkgdatadir)/swfs/PreLoaderTemplate.swf
+       $(INSTALL_DATA) ./tessel_loader.swf $(pkgdatadir)/swfs/tessel_loader.swf
+       $(INSTALL_DATA) ./swft_loader.swf $(pkgdatadir)/swfs/swft_loader.swf
+-      rm -f $(pkgdatadir)/swfs/default_viewer.swf -o -L $(pkgdatadir)/swfs/default_viewer.swf
+-      $(LN_S) $(pkgdatadir)/swfs/simple_viewer.swf $(pkgdatadir)/swfs/default_viewer.swf
+-      rm -f $(pkgdatadir)/swfs/default_loader.swf -o -L $(pkgdatadir)/swfs/default_loader.swf
+-      $(LN_S) $(pkgdatadir)/swfs/tessel_loader.swf $(pkgdatadir)/swfs/default_loader.swf
++      rm -f $(pkgdatadir)/swfs/default_viewer.swf
++      $(LN_S) simple_viewer.swf $(pkgdatadir)/swfs/default_viewer.swf
++      rm -f $(pkgdatadir)/swfs/default_loader.swf
++      $(LN_S) tessel_loader.swf $(pkgdatadir)/swfs/default_loader.swf
+               
+ uninstall:
diff --git a/swftools-poppler.patch b/swftools-poppler.patch
new file mode 100644 (file)
index 0000000..c5eeebc
--- /dev/null
@@ -0,0 +1,1279 @@
+From git://people.freedesktop.org/~carlosgc/swftools ; git diff master xpdf303
+diff --git a/config.h.in b/config.h.in
+index 0ec7fb9..51fe5a3 100644
+--- a/config.h.in
++++ b/config.h.in
+@@ -266,6 +266,7 @@
+ #ifdef HAVE_POPPLER
+ #define GString GooString
+ #define GHash GooHash
++#define GHashIter GooHashIter
+ #endif
+ #ifdef HAVE_ZZIP_LIB_H
+diff --git a/configure.in b/configure.in
+index 8b04d6f..7895338 100644
+--- a/configure.in
++++ b/configure.in
+@@ -331,7 +331,7 @@ xpdf_include=
+ if test "x$USE_POPPLER" = "xtrue"; then
+     AC_DEFINE([HAVE_POPPLER],[1],[use poppler])
+-    #PKG_CHECK_MODULES([POPPLER],[poppler poppler-splash],,[poppler_pkgconfig=no])
++    PKG_CHECK_MODULES([POPPLER],[poppler >= 0.20.0 poppler-splash >= 0.20.0],,[poppler_pkgconfig=no])
+     if test "x$poppler_pkgconfig" = "xno"; then
+         AC_LANG_PUSH([C++])
+         AC_CHECK_HEADERS([OutputDev.h],[
+diff --git a/lib/pdf/BitmapOutputDev.cc b/lib/pdf/BitmapOutputDev.cc
+index 7b175b3..11fa842 100644
+--- a/lib/pdf/BitmapOutputDev.cc
++++ b/lib/pdf/BitmapOutputDev.cc
+@@ -23,10 +23,12 @@
+ #include <assert.h>
+ #include "BitmapOutputDev.h"
+ #include "CharOutputDev.h"
++#include "GFXSplashOutputDev.h"
+ #ifdef HAVE_POPPLER
+   #include "splash/SplashBitmap.h"
+   #include "splash/SplashPattern.h"
++  #include "splash/SplashGlyphBitmap.h"
+   #include "splash/Splash.h"
+ #else
+   #include "xpdf/config.h"
+@@ -70,28 +72,28 @@ BitmapOutputDev::BitmapOutputDev(InfoOutputDev*info, PDFDoc*doc, int*page2page,
+     this->xref = doc->getXRef();
+     
+     /* color graphic output device, for creating bitmaps */
+-    this->rgbdev = new SplashOutputDev(splashModeRGB8, 1, gFalse, splash_white, gTrue, gTrue);
++    this->rgbdev = new GFXSplashOutputDev(splashModeRGB8, 1, gFalse, splash_white, gTrue, gTrue);
+   
+     /* color mode for binary bitmaps */
+     SplashColorMode colorMode = splashModeMono1;
+     /* two devices for testing things against clipping: one clips, the other doesn't */
+-    this->clip0dev = new SplashOutputDev(colorMode, 1, gFalse, splash_black, gTrue, gFalse);
+-    this->clip1dev = new SplashOutputDev(colorMode, 1, gFalse, splash_black, gTrue, gFalse);
++    this->clip0dev = new GFXSplashOutputDev(colorMode, 1, gFalse, splash_black, gTrue, gFalse);
++    this->clip1dev = new GFXSplashOutputDev(colorMode, 1, gFalse, splash_black, gTrue, gFalse);
+     
+     /* device indicating where polygonal pixels were drawn */
+-    this->boolpolydev = new SplashOutputDev(colorMode, 1, gFalse, splash_black, gTrue, gFalse);
++    this->boolpolydev = new GFXSplashOutputDev(colorMode, 1, gFalse, splash_black, gTrue, gFalse);
+     /* device indicating where text pixels were drawn */
+-    this->booltextdev = new SplashOutputDev(colorMode, 1, gFalse, splash_black, gTrue, gFalse);
++    this->booltextdev = new GFXSplashOutputDev(colorMode, 1, gFalse, splash_black, gTrue, gFalse);
+     /* device for handling texts and links */
+     this->gfxdev = new CharOutputDev(info, this->doc, page2page, num_pages, x, y, x1, y1, x2, y2);
+-    this->rgbdev->startDoc(this->xref);
+-    this->boolpolydev->startDoc(this->xref);
+-    this->booltextdev->startDoc(this->xref);
+-    this->clip0dev->startDoc(this->xref);
+-    this->clip1dev->startDoc(this->xref);
++    this->rgbdev->startDoc(POPPLER_STARTDOC_ARG);
++    this->boolpolydev->startDoc(POPPLER_STARTDOC_ARG);
++    this->booltextdev->startDoc(POPPLER_STARTDOC_ARG);
++    this->clip0dev->startDoc(POPPLER_STARTDOC_ARG);
++    this->clip1dev->startDoc(POPPLER_STARTDOC_ARG);
+     this->gfxoutput_string = device_new_record();
+     this->gfxoutput = device_new_record();
+@@ -153,14 +155,6 @@ BitmapOutputDev::~BitmapOutputDev()
+ }
+-GBool BitmapOutputDev::getVectorAntialias()
+-{
+-    return this->rgbdev->getVectorAntialias();
+-}
+-void BitmapOutputDev::setVectorAntialias(GBool vaa)
+-{
+-    this->rgbdev->setVectorAntialias(vaa);
+-}
+ void BitmapOutputDev::setDevice(gfxdevice_t*dev)
+ {
+     this->dev = dev;
+@@ -188,8 +182,8 @@ void BitmapOutputDev::flushBitmap()
+     int bitmap_width = rgbdev->getBitmapWidth();
+     int bitmap_height = rgbdev->getBitmapHeight();
+-    if(sizeof(SplashColor)!=3) {
+-      msg("<error> sizeof(SplashColor)!=3");
++    if(sizeof(SplashColor)<3) {
++      msg("<error> sizeof(SplashColor)<3");
+       return;
+     }
+@@ -992,9 +986,10 @@ GBool BitmapOutputDev::intersection(SplashBitmap*boolpoly, SplashBitmap*booltext
+ GBool BitmapOutputDev::checkPageSlice(Page *page, double hDPI, double vDPI,
+              int rotate, GBool useMediaBox, GBool crop,
+              int sliceX, int sliceY, int sliceW, int sliceH,
+-             GBool printing, Catalog *catalog,
++             GBool printing,
+              GBool (*abortCheckCbk)(void *data),
+-             void *abortCheckCbkData)
++             void *abortCheckCbkData
++             POPPLER_CHECK_PAGE_SLICE_ANNOT_CBK POPPLER_CHECK_PAGE_SLICE_ANNOT_CBK_DATA)
+ {
+     this->setPage(page);
+     gfxdev->setPage(page);
+@@ -1084,13 +1079,13 @@ GBool BitmapOutputDev::useTilingPatternFill()
+     return rgbdev->useTilingPatternFill();
+ }
+-GBool BitmapOutputDev::useShadedFills()
++GBool BitmapOutputDev::useShadedFills(POPPLER_SHADED_FILL_TYPE)
+ {
+-    boolpolydev->useShadedFills();
+-    booltextdev->useShadedFills();
+-    clip0dev->useShadedFills();
+-    clip1dev->useShadedFills();
+-    return rgbdev->useShadedFills();
++    boolpolydev->useShadedFills(POPPLER_SHADED_FILL_TYPE_ARG);
++    booltextdev->useShadedFills(POPPLER_SHADED_FILL_TYPE_ARG);
++    clip0dev->useShadedFills(POPPLER_SHADED_FILL_TYPE_ARG);
++    clip1dev->useShadedFills(POPPLER_SHADED_FILL_TYPE_ARG);
++    return rgbdev->useShadedFills(POPPLER_SHADED_FILL_TYPE_ARG);
+ }
+ GBool BitmapOutputDev::useDrawForm()
+@@ -1507,17 +1502,19 @@ void BitmapOutputDev::eoFill(GfxState *state)
+     dbg_newdata("eofill");
+ }
+-POPPLER_TILING_PATERN_RETURN BitmapOutputDev::tilingPatternFill(GfxState *state, POPPLER_TILING_PATERN_GFX Object *str,
+-                             int paintType, Dict *resDict,
++POPPLER_TILING_PATERN_RETURN BitmapOutputDev::tilingPatternFill(GfxState *state, Gfx *gfx, POPPLER_TILING_PATTERN_CATALOG Object *str,
++                             POPPLER_TILING_PATTERN_PMAT int paintType, POPPLER_TILING_PATTERN_TILING_TYPE Dict *resDict,
+                              double *mat, double *bbox,
+                              int x0, int y0, int x1, int y1,
+                              double xStep, double yStep) 
+ {
+     msg("<debug> tilingPatternFill");
+-    boolpolydev->tilingPatternFill(state, POPPLER_TILING_PATERN_GFX_ARG str, paintType, resDict, mat,
++    boolpolydev->tilingPatternFill(state, gfx, POPPLER_TILING_PATTERN_CATALOG_ARG str, POPPLER_TILING_PATTERN_PMAT_ARG paintType,
++                                   POPPLER_TILING_PATTERN_TILING_TYPE_ARG resDict, mat,
+                                    bbox, x0, y0, x1, y1, xStep, yStep);
+     checkNewBitmap(UNKNOWN_BOUNDING_BOX);
+-    rgbdev->tilingPatternFill(state, POPPLER_TILING_PATERN_GFX_ARG str, paintType, resDict, mat,
++    rgbdev->tilingPatternFill(state, gfx, POPPLER_TILING_PATTERN_CATALOG_ARG str, POPPLER_TILING_PATTERN_PMAT_ARG paintType,
++                              POPPLER_TILING_PATTERN_TILING_TYPE_ARG resDict, mat,
+                               bbox, x0, y0, x1, y1, xStep, yStep);
+     dbg_newdata("tilingpatternfill");
+ #ifdef HAVE_POPPLER
+@@ -1615,7 +1612,7 @@ void BitmapOutputDev::clearBoolTextDev()
+ #define USE_GETGLYPH_BBOX
+-static void getGlyphBbox(GfxState*state, SplashOutputDev*splash, double x, double y, double originX, double originY, CharCode code, int*_x1, int*_y1, int*_x2, int*_y2)
++static void getGlyphBbox(GfxState*state, GFXSplashOutputDev*splash, double x, double y, double originX, double originY, CharCode code, int*_x1, int*_y1, int*_x2, int*_y2)
+ {
+ #ifdef USE_GETGLYPH_BBOX
+     /* use getglyph to derive bounding box */
+@@ -1634,7 +1631,14 @@ static void getGlyphBbox(GfxState*state, SplashOutputDev*splash, double x, doubl
+     SplashCoord*matrix = font->getMatrix();
+-    if(font && font->getGlyph(code, xFrac, yFrac, &glyph)) {
++#ifdef HAVE_POPPLER
++    double clipx1, clipy1, clipx2, clipy2;
++    state->getClipBBox(&clipx1, &clipy1, &clipx2, &clipy2);
++    SplashClip clip(clipx1, clipy1, clipx2, clipy2, gFalse);
++    SplashClipResult clipRes;
++#endif
++
++    if(font && font->getGlyph(code, xFrac, yFrac, &glyph POPPLER_GET_GLYPH_ARGS)) {
+         x1 = floor(x0-glyph.x);
+         y1 = floor(y0-glyph.y);
+         x2 = ceil(x0-glyph.x+glyph.w);
+@@ -1648,7 +1652,7 @@ static void getGlyphBbox(GfxState*state, SplashOutputDev*splash, double x, doubl
+     double x0,y0;
+     state->transform(x-originX,y-originY,&x0,&y0);
+     int x1 = (int)x0, x2 = (int)x0+1, y1 = (int)y0, y2 = (int)y0+1;
+-    SplashFont*font = clip0dev->getCurrentFont();
++    SplashFont*font = splash->getCurrentFont();
+     SplashPath*path = font?font->getGlyphPath(code):NULL;
+     if(path) {
+         path->offset((SplashCoord)x, (SplashCoord)y);
+@@ -1980,10 +1984,10 @@ void BitmapOutputDev::drawForm(Ref id)
+     rgbdev->drawForm(id);
+ }
+-void BitmapOutputDev::processLink(Link *link, Catalog *catalog)
++void BitmapOutputDev::processLink(Link *link)
+ {
+     msg("<debug> processLink");
+-    gfxdev->processLink(link, catalog);
++    gfxdev->processLink(link);
+ }
+ void BitmapOutputDev::flushEverything()
+ {
+diff --git a/lib/pdf/BitmapOutputDev.h b/lib/pdf/BitmapOutputDev.h
+index 3644a0e..1ad7ec6 100644
+--- a/lib/pdf/BitmapOutputDev.h
++++ b/lib/pdf/BitmapOutputDev.h
+@@ -27,6 +27,7 @@
+ #include "../../config.h"
+ #include "CharOutputDev.h"
+ #include "InfoOutputDev.h"
++#include "GFXSplashOutputDev.h"
+ #include "PDFDoc.h"
+ #include "CommonOutputDev.h"
+ #include "popplercompat.h"
+@@ -58,7 +59,7 @@ public:
+     virtual GBool upsideDown();
+     virtual GBool useDrawChar();
+     virtual GBool useTilingPatternFill();
+-    virtual GBool useShadedFills();
++    virtual GBool useShadedFills(POPPLER_SHADED_FILL_TYPE);
+     virtual GBool useDrawForm();
+     virtual GBool interpretType3Chars();
+     virtual GBool needNonText();
+@@ -66,9 +67,11 @@ public:
+     virtual GBool checkPageSlice(Page *page, double hDPI, double vDPI,
+                              int rotate, GBool useMediaBox, GBool crop,
+                              int sliceX, int sliceY, int sliceW, int sliceH,
+-                             GBool printing, Catalog *catalog,
++                             GBool printing,
+                              GBool (*abortCheckCbk)(void *data) = NULL,
+-                             void *abortCheckCbkData = NULL);
++                             void *abortCheckCbkData = NULL
++                               POPPLER_CHECK_PAGE_SLICE_ANNOT_CBK_H
++                               POPPLER_CHECK_PAGE_SLICE_ANNOT_CBK_DATA_H);
+     virtual void beginPage(GfxState *state, int pageNum);
+     virtual void endPage();
+@@ -110,8 +113,9 @@ public:
+     virtual void fill(GfxState *state);
+     virtual void eoFill(GfxState *state);
+     virtual POPPLER_TILING_PATERN_RETURN tilingPatternFill(
+-             GfxState *state, POPPLER_TILING_PATERN_GFX Object *str,
+-                             int paintType, Dict *resDict,
++                               GfxState *state, Gfx *gfx, POPPLER_TILING_PATTERN_CATALOG Object *str,
++                               POPPLER_TILING_PATTERN_PMAT
++                             int paintType, POPPLER_TILING_PATTERN_TILING_TYPE Dict *resDict,
+                              double *mat, double *bbox,
+                              int x0, int y0, int x1, int y1,
+                              double xStep, double yStep);
+@@ -178,12 +182,9 @@ public:
+     virtual void setSoftMask(GfxState *state, double *bbox, GBool alpha, Function *transferFunc, GfxColor *backdropColor);
+     virtual void clearSoftMask(GfxState *state);
+-    virtual void processLink(Link *link, Catalog *catalog);
++    virtual void processLink(Link *link);
+   
+-    virtual void setVectorAntialias(GBool vaa);
+-    virtual GBool getVectorAntialias();
+-    
+ private:
+     void flushEverything();
+     void clearClips(int x1, int y1, int x2, int y2);
+@@ -211,11 +212,11 @@ private:
+     SplashPath*bboxpath;
+-    SplashOutputDev*rgbdev;
+-    SplashOutputDev*clip0dev;
+-    SplashOutputDev*clip1dev;
+-    SplashOutputDev*boolpolydev;
+-    SplashOutputDev*booltextdev;
++    GFXSplashOutputDev*rgbdev;
++    GFXSplashOutputDev*clip0dev;
++    GFXSplashOutputDev*clip1dev;
++    GFXSplashOutputDev*boolpolydev;
++    GFXSplashOutputDev*booltextdev;
+     SplashBitmap*rgbbitmap;
+     SplashBitmap*clip0bitmap;
+diff --git a/lib/pdf/CharOutputDev.cc b/lib/pdf/CharOutputDev.cc
+index cd7ceff..2e6fd1a 100644
+--- a/lib/pdf/CharOutputDev.cc
++++ b/lib/pdf/CharOutputDev.cc
+@@ -83,7 +83,6 @@ struct fontentry {
+     char*pfb;
+     int pfblen;
+     char*fullfilename;
+-    DisplayFontParam *dfp;
+ } pdf2t1map[] ={
+ {"Times-Roman",           "n021003l", n021003l_afm, n021003l_afm_len, n021003l_pfb, n021003l_pfb_len},
+ {"Times-Italic",          "n021023l", n021023l_afm, n021023l_afm_len, n021023l_pfb, n021023l_pfb_len},
+@@ -198,6 +197,7 @@ void unlinkfont(char* filename)
+     }
+ }
++#ifndef HAVE_POPPLER
+ static int config_use_fontconfig = 1;
+ static int fcinitcalled = 0; 
+@@ -424,16 +424,7 @@ char* fontconfig_searchForFont(char*name)
+ #endif
+ }
+-static DisplayFontParamKind detectFontType(const char*filename)
+-{
+-    if(strstr(filename, ".ttf") || strstr(filename, ".TTF"))
+-      return displayFontTT;
+-    if(strstr(filename, ".pfa") || strstr(filename, ".PFA") || strstr(filename, ".pfb"))
+-      return displayFontT1;
+-    return displayFontTT;
+-}
+-
+-DisplayFontParam *GFXGlobalParams::getDisplayFont(GString *fontName)
++GString *GFXGlobalParams::findFontFile(GString *fontName)
+ {
+     msg("<verbose> looking for font %s", fontName->getCString());
+@@ -450,11 +441,8 @@ DisplayFontParam *GFXGlobalParams::getDisplayFont(GString *fontName)
+               } else {
+                   msg("<verbose> Storing standard PDF font %s at %s", name, pdf2t1map[t].fullfilename);
+               }
+-              DisplayFontParam *dfp = new DisplayFontParam(new GString(fontName), displayFontT1);
+-              dfp->t1.fileName = new GString(pdf2t1map[t].fullfilename);
+-              pdf2t1map[t].dfp = dfp;
+           }
+-          return pdf2t1map[t].dfp;
++            return pdf2t1map[t].fullfilename ? new GString(pdf2t1map[t].fullfilename) : NULL;
+       }
+     }
+     
+@@ -485,30 +473,16 @@ DisplayFontParam *GFXGlobalParams::getDisplayFont(GString *fontName)
+     }
+     if(filename) {
++        GString*retval = new GString(filename);
+         msg("<verbose> Font %s maps to %s\n", name, filename);
+-      DisplayFontParamKind kind = detectFontType(filename);
+-        DisplayFontParam *dfp = new DisplayFontParam(new GString(fontName), kind);
+-      if(kind == displayFontTT) {
+-          dfp->tt.fileName = new GString(filename);
+-      } else {
+-          dfp->t1.fileName = new GString(filename);
+-      }
+-      free(filename);
+-        return dfp;
++        free(filename);
++        return retval;
+     } else {
+       msg("<verbose> Font %s not found\n", name);
+-      return GlobalParams::getDisplayFont(fontName);
+-    }
+-}
+-
+-DisplayFontParam *GFXGlobalParams::getDisplayCIDFont(GString *fontName, GString *collection)
+-{
+-    DisplayFontParam*dfp = GlobalParams::getDisplayCIDFont(fontName, collection);
+-    if(!dfp) {
+-        dfp = this->getDisplayFont(fontName);
++        return GlobalParams::findFontFile(fontName);
+     }
+-    return dfp;
+ }
++#endif // HAVE_POPPLER
+ CharOutputDev::CharOutputDev(InfoOutputDev*info, PDFDoc*doc, int*page2page, int num_pages, int x, int y, int x1, int y1, int x2, int y2)
+ :CommonOutputDev(info, doc, page2page, num_pages, x, y, x1, y1, x2, y2)
+@@ -652,7 +626,7 @@ static void dumpFontInfo(const char*loglevel, GfxFont*font)
+   if(embedded)
+    msg("%s| Embedded id: %s id: %d",loglevel, FIXNULL(embeddedName), embRef.num);
+-  gstr = font->getExtFontFile();
++  gstr = globalParams->findFontFile(font->getName());
+   if(gstr)
+    msg("%s| External Font file: %s", loglevel, FIXNULL(gstr->getCString()));
+@@ -1046,7 +1020,7 @@ GFXLink::~GFXLink()
+ }
+-void CharOutputDev::processLink(Link *link, Catalog *catalog)
++void CharOutputDev::processLink(Link *link)
+ {
+     double x1, y1, x2, y2;
+     
+@@ -1068,13 +1042,13 @@ void CharOutputDev::processLink(Link *link, Catalog *catalog)
+             LinkGoTo *ha=(LinkGoTo *)link->getAction();
+             LinkDest *dest=NULL;
+             if (ha->getDest()==NULL) 
+-                dest=catalog->findDest(ha->getNamedDest());
++                dest=this->doc->findDest(ha->getNamedDest());
+             else 
+                 dest=ha->getDest()->copy();
+             if (dest){ 
+               if (dest->isPageRef()){
+                 Ref pageref=dest->getPageRef();
+-                page=catalog->findPage(pageref.num,pageref.gen);
++                page=this->doc->findPage(pageref.num,pageref.gen);
+               }
+               else  page=dest->getPageNum();
+               sprintf(buf, "%d", page);
+diff --git a/lib/pdf/CharOutputDev.h b/lib/pdf/CharOutputDev.h
+index 0801090..86124db 100644
+--- a/lib/pdf/CharOutputDev.h
++++ b/lib/pdf/CharOutputDev.h
+@@ -33,7 +33,7 @@ public:
+   virtual GBool upsideDown();
+   virtual GBool useDrawChar();
+-  virtual void processLink(Link *link, Catalog *catalog);
++  virtual void processLink(Link *link);
+   virtual void saveState(GfxState *state) ;
+   virtual void restoreState(GfxState *state) ;
+@@ -108,12 +108,13 @@ class GFXLink {
+     ~GFXLink();
+ };
++#ifndef HAVE_POPPLER
+ class GFXGlobalParams:  public GlobalParams {
+     public:
+     GFXGlobalParams();
+     ~GFXGlobalParams();
+-    virtual DisplayFontParam *getDisplayFont(GString *fontName);
+-    virtual DisplayFontParam *getDisplayCIDFont(GString *fontName, GString *collection);
++    virtual GString *findFontFile(GString *fontName);
+ };
++#endif
+ #endif //__charoutputdev_h__
+diff --git a/lib/pdf/CommonOutputDev.h b/lib/pdf/CommonOutputDev.h
+index db2f4d8..ae10d7c 100644
+--- a/lib/pdf/CommonOutputDev.h
++++ b/lib/pdf/CommonOutputDev.h
+@@ -80,7 +80,9 @@ class CommonOutputDev: public OutputDev
+                              int sliceX, int sliceY, int sliceW, int sliceH,
+                              GBool printing, Catalog *catalog,
+                              GBool (*abortCheckCbk)(void *data) = NULL,
+-                             void *abortCheckCbkData = NULL)
++                             void *abortCheckCbkData = NULL
++                               POPPLER_CHECK_PAGE_SLICE_ANNOT_CBK_H
++                               POPPLER_CHECK_PAGE_SLICE_ANNOT_CBK_DATA_H)
+     {
+         this->setPage(page);
+         return gTrue;
+#diff --git a/lib/pdf/DummyOutputDev.cc b/lib/pdf/DummyOutputDev.cc
+#index a89b5c7..6ad7608 100644
+#--- a/lib/pdf/DummyOutputDev.cc
+#+++ b/lib/pdf/DummyOutputDev.cc
+#@@ -64,9 +64,9 @@ GBool DummyOutputDev::useTilingPatternFill()
+#     return rgbdev->useTilingPatternFill();
+# }
+# 
+#-GBool DummyOutputDev::useShadedFills()
+#+GBool DummyOutputDev::useShadedFills(POPPLER_SHADED_FILL_TYPE)
+# {
+#-    return rgbdev->useShadedFills();
+#+    return rgbdev->useShadedFills(POPPLER_SHADED_FILL_TYPE_ARG);
+# }
+# 
+# GBool DummyOutputDev::useDrawForm()
+#@@ -348,7 +348,7 @@ void DummyOutputDev::drawForm(Ref id)
+#     rgbdev->drawForm(id);
+# }
+# 
+#-void DummyOutputDev::processLink(Link *link, Catalog *catalog)
+#+void DummyOutputDev::processLink(Link *link)
+# {
+# }
+# 
+#diff --git a/lib/pdf/DummyOutputDev.h b/lib/pdf/DummyOutputDev.h
+#index ca831a8..6cc0519 100644
+#--- a/lib/pdf/DummyOutputDev.h
+#+++ b/lib/pdf/DummyOutputDev.h
+#@@ -41,7 +41,7 @@ public:
+#     virtual GBool upsideDown();
+#     virtual GBool useDrawChar();
+#     virtual GBool useTilingPatternFill();
+#-    virtual GBool useShadedFills();
+#+    virtual GBool useShadedFills(POPPLER_SHADED_FILL_TYPE);
+#     virtual GBool useDrawForm();
+#     virtual GBool interpretType3Chars();
+#     virtual GBool needNonText();
+#@@ -161,7 +161,7 @@ public:
+#     virtual void setSoftMask(GfxState *state, double *bbox, GBool alpha, Function *transferFunc, GfxColor *backdropColor);
+#     virtual void clearSoftMask(GfxState *state);
+# 
+#-    virtual void processLink(Link *link, Catalog *catalog);
+#+    virtual void processLink(Link *link);
+#     
+#     OutputDev*rgbdev;
+# private:
+diff --git a/lib/pdf/FullBitmapOutputDev.cc b/lib/pdf/FullBitmapOutputDev.cc
+index 8faaa0b..b9efc8e 100644
+--- a/lib/pdf/FullBitmapOutputDev.cc
++++ b/lib/pdf/FullBitmapOutputDev.cc
+@@ -54,7 +54,7 @@ FullBitmapOutputDev::FullBitmapOutputDev(InfoOutputDev*info, PDFDoc*doc, int*pag
+     /* device for handling links */
+     this->gfxdev = new CharOutputDev(info, this->doc, page2page, num_pages, x, y, x1, y1, x2, y2);
+-    this->rgbdev->startDoc(this->xref);
++    this->rgbdev->startDoc(POPPLER_STARTDOC_ARG);
+ }
+ FullBitmapOutputDev::~FullBitmapOutputDev()
+ {
+@@ -66,14 +66,6 @@ FullBitmapOutputDev::~FullBitmapOutputDev()
+     }
+ }
+-GBool FullBitmapOutputDev::getVectorAntialias()
+-{
+-    return this->rgbdev->getVectorAntialias();
+-}
+-void FullBitmapOutputDev::setVectorAntialias(GBool vaa)
+-{
+-    this->rgbdev->setVectorAntialias(vaa);
+-}
+ void FullBitmapOutputDev::setDevice(gfxdevice_t*dev)
+ {
+     this->dev = dev;
+@@ -138,8 +130,8 @@ void FullBitmapOutputDev::flushBitmap()
+     if((xmax-xmin)<=0 || (ymax-ymin)<=0) // no bitmap, nothing to do
+       return;
+-    if(sizeof(SplashColor)!=3) {
+-      msg("<error> sizeof(SplashColor)!=3");
++    if(sizeof(SplashColor)<3) {
++      msg("<error> sizeof(SplashColor)<3");
+       return;
+     }
+     //xmin = ymin = 0;
+@@ -187,9 +179,10 @@ void FullBitmapOutputDev::flushBitmap()
+ GBool FullBitmapOutputDev::checkPageSlice(Page *page, double hDPI, double vDPI,
+              int rotate, GBool useMediaBox, GBool crop,
+              int sliceX, int sliceY, int sliceW, int sliceH,
+-             GBool printing, Catalog *catalog,
++             GBool printing,
+              GBool (*abortCheckCbk)(void *data),
+-             void *abortCheckCbkData)
++             void *abortCheckCbkData
++             POPPLER_CHECK_PAGE_SLICE_ANNOT_CBK POPPLER_CHECK_PAGE_SLICE_ANNOT_CBK_DATA)
+ {
+     this->setPage(page);
+     gfxdev->setPage(page);
+@@ -222,9 +215,9 @@ GBool FullBitmapOutputDev::useTilingPatternFill()
+ {
+     return rgbdev->useTilingPatternFill();
+ }
+-GBool FullBitmapOutputDev::useShadedFills()
++GBool FullBitmapOutputDev::useShadedFills(POPPLER_SHADED_FILL_TYPE)
+ {
+-    return rgbdev->useShadedFills();
++    return rgbdev->useShadedFills(POPPLER_SHADED_FILL_TYPE_ARG);
+ }
+ GBool FullBitmapOutputDev::useDrawForm()
+ {
+@@ -380,18 +373,20 @@ void FullBitmapOutputDev::eoFill(GfxState *state)
+     msg("<debug> eoFill");
+     rgbdev->eoFill(state);
+ }
+-POPPLER_TILING_PATERN_RETURN FullBitmapOutputDev::tilingPatternFill(GfxState *state, POPPLER_TILING_PATERN_GFX
+-             Object *str,
+-                             int paintType, Dict *resDict,
++POPPLER_TILING_PATERN_RETURN FullBitmapOutputDev::tilingPatternFill(GfxState *state, Gfx *gfx,
++                               POPPLER_TILING_PATTERN_CATALOG Object *str,
++                               POPPLER_TILING_PATTERN_PMAT
++                             int paintType, POPPLER_TILING_PATTERN_TILING_TYPE Dict *resDict,
+                              double *mat, double *bbox,
+                              int x0, int y0, int x1, int y1,
+                              double xStep, double yStep)
+ {
+     msg("<debug> tilingPatternFill");
++    rgbdev->tilingPatternFill(state, gfx, POPPLER_TILING_PATTERN_CATALOG_ARG str, POPPLER_TILING_PATTERN_PMAT_ARG paintType,
++                              POPPLER_TILING_PATTERN_TILING_TYPE_ARG resDict, mat, bbox, x0, y0, x1, y1, xStep, yStep);
+ #ifdef HAVE_POPPLER
+-    return
++    return gTrue;
+ #endif
+-    rgbdev->tilingPatternFill(state, POPPLER_TILING_PATERN_GFX_ARG str, paintType, resDict, mat, bbox, x0, y0, x1, y1, xStep, yStep);
+ }
+ GBool FullBitmapOutputDev::functionShadedFill(GfxState *state, GfxFunctionShading *shading) 
+@@ -536,10 +531,10 @@ void FullBitmapOutputDev::drawForm(Ref id)
+     rgbdev->drawForm(id);
+ }
+-void FullBitmapOutputDev::processLink(Link *link, Catalog *catalog)
++void FullBitmapOutputDev::processLink(Link *link)
+ {
+     msg("<debug> processLink");
+-    gfxdev->processLink(link, catalog);
++    gfxdev->processLink(link);
+ }
+ void FullBitmapOutputDev::beginTransparencyGroup(GfxState *state, double *bbox,
+diff --git a/lib/pdf/FullBitmapOutputDev.h b/lib/pdf/FullBitmapOutputDev.h
+index d9eb543..e9ce21e 100644
+--- a/lib/pdf/FullBitmapOutputDev.h
++++ b/lib/pdf/FullBitmapOutputDev.h
+@@ -47,7 +47,7 @@ public:
+     virtual GBool upsideDown();
+     virtual GBool useDrawChar();
+     virtual GBool useTilingPatternFill();
+-    virtual GBool useShadedFills();
++    virtual GBool useShadedFills(POPPLER_SHADED_FILL_TYPE);
+     virtual GBool useDrawForm();
+     virtual GBool interpretType3Chars();
+     virtual GBool needNonText();
+@@ -55,9 +55,11 @@ public:
+     virtual GBool checkPageSlice(Page *page, double hDPI, double vDPI,
+                              int rotate, GBool useMediaBox, GBool crop,
+                              int sliceX, int sliceY, int sliceW, int sliceH,
+-                             GBool printing, Catalog *catalog,
++                             GBool printing,
+                              GBool (*abortCheckCbk)(void *data) = NULL,
+-                             void *abortCheckCbkData = NULL);
++                             void *abortCheckCbkData = NULL
++                               POPPLER_CHECK_PAGE_SLICE_ANNOT_CBK_H
++                               POPPLER_CHECK_PAGE_SLICE_ANNOT_CBK_DATA_H);
+     virtual void beginPage(GfxState *state, int pageNum);
+     virtual void endPage();
+@@ -98,8 +100,9 @@ public:
+     virtual void fill(GfxState *state);
+     virtual void eoFill(GfxState *state);
+     virtual POPPLER_TILING_PATERN_RETURN tilingPatternFill(GfxState *state,
+-             POPPLER_TILING_PATERN_GFX Object *str,
+-                             int paintType, Dict *resDict,
++                               Gfx *gfx, POPPLER_TILING_PATTERN_CATALOG Object *str,
++                               POPPLER_TILING_PATTERN_PMAT
++                             int paintType, POPPLER_TILING_PATTERN_TILING_TYPE Dict *resDict,
+                              double *mat, double *bbox,
+                              int x0, int y0, int x1, int y1,
+                              double xStep, double yStep);
+@@ -166,12 +169,9 @@ public:
+     virtual void setSoftMask(GfxState *state, double *bbox, GBool alpha, Function *transferFunc, GfxColor *backdropColor);
+     virtual void clearSoftMask(GfxState *state);
+-    virtual void processLink(Link *link, Catalog *catalog);
++    virtual void processLink(Link *link);
+   
+-    virtual void setVectorAntialias(GBool vaa);
+-    virtual GBool getVectorAntialias();
+-    
+ private:
+     void flushBitmap();
+     char config_extrafontdata;
+diff --git a/lib/pdf/GFXSplashOutputDev.h b/lib/pdf/GFXSplashOutputDev.h
+new file mode 100644
+index 0000000..05cf47b
+--- /dev/null
++++ b/lib/pdf/GFXSplashOutputDev.h
+@@ -0,0 +1,58 @@
++/* GFXSplashOutputDev.h
++   Output device derived from SplashOutputDev.
++
++   This file is part of swftools.
++
++   Swftools is free software; you can redistribute it and/or modify
++   it under the terms of the GNU General Public License as published by
++   the Free Software Foundation; either version 2 of the License, or
++   (at your option) any later version.
++
++   Swftools is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++   GNU General Public License for more details.
++
++   You should have received a copy of the GNU General Public License
++   along with swftools; if not, write to the Free Software
++   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA */
++
++#ifndef __GFXSplashOutputDev_h__
++#define __GFXSplashOutputDev_h__
++
++#include "SplashOutputDev.h"
++
++#ifdef HAVE_POPPLER
++
++#include "../../config.h"
++#include <splash/SplashTypes.h>
++#include <splash/SplashPath.h>
++#include <splash/SplashFont.h>
++#include <splash/SplashFontFile.h>
++
++class GFXSplashOutputDev: public SplashOutputDev {
++public:
++    GFXSplashOutputDev(SplashColorMode colorModeA, int bitmapRowPadA,
++                       GBool reverseVideoA, SplashColorPtr paperColorA,
++                       GBool bitmapTopDownA = gTrue,
++                       GBool allowAntialiasA = gTrue)
++        : SplashOutputDev(colorModeA, bitmapRowPadA, reverseVideoA, paperColorA, bitmapTopDownA, allowAntialiasA)
++    {
++        needFontUpdate = gFalse;
++    }
++
++    // OutputDev:
++    virtual void restoreState(GfxState *state) { SplashOutputDev::restoreState(state); needFontUpdate = gTrue; }
++
++    virtual void updateAll(GfxState *state) { SplashOutputDev::updateAll(state); needFontUpdate = gTrue; }
++    virtual void updateFont(GfxState *state) { SplashOutputDev::updateFont(state); needFontUpdate = gTrue; }
++
++    // SplashOutputDev:
++    void doUpdateFont(GfxState *state) { SplashOutputDev::doUpdateFont(state); needFontUpdate = gFalse; }
++
++    GBool needFontUpdate;         // set when the font needs to be updated
++};
++
++#endif // HAVE_POPPLER
++
++#endif
+diff --git a/lib/pdf/InfoOutputDev.cc b/lib/pdf/InfoOutputDev.cc
+index edfb7e7..073bf99 100644
+--- a/lib/pdf/InfoOutputDev.cc
++++ b/lib/pdf/InfoOutputDev.cc
+@@ -1,7 +1,7 @@
+ #include "../../config.h"
+ #include "Object.h"
+ #include "InfoOutputDev.h"
+-#include "SplashOutputDev.h"
++#include "GFXSplashOutputDev.h"
+ #include "GfxState.h"
+ #include "CommonOutputDev.h"
+ #include "../log.h"
+@@ -90,7 +90,7 @@ static type_t fontclass_type = {
+     fontclass_destroy
+ };
+-InfoOutputDev::InfoOutputDev(XRef*xref) 
++InfoOutputDev::InfoOutputDev(PDFDoc*doc)
+ {
+     num_links = 0;
+     num_jpeg_images = 0;
+@@ -103,8 +103,8 @@ InfoOutputDev::InfoOutputDev(XRef*xref)
+     currentglyph = 0;
+     previous_was_char = 0;
+     SplashColor white = {255,255,255};
+-    splash = new SplashOutputDev(splashModeRGB8,320,0,white,0,0);
+-    splash->startDoc(xref);
++    splash = new GFXSplashOutputDev(splashModeRGB8,320,0,white,0,0);
++    splash->startDoc(INFO_OUTPUT_DEV_STARTDOC_ARG);
+     last_font = 0;
+     current_type3_font = 0;
+     fontcache = dict_new2(&fontclass_type);
+@@ -452,9 +452,10 @@ GBool InfoOutputDev::useTilingPatternFill() {return gFalse;}
+ GBool InfoOutputDev::checkPageSlice(Page *page, double hDPI, double vDPI,
+              int rotate, GBool useMediaBox, GBool crop,
+              int sliceX, int sliceY, int sliceW, int sliceH,
+-             GBool printing, Catalog *catalog,
++             GBool printing,
+              GBool (*abortCheckCbk)(void *data),
+-             void *abortCheckCbkData)
++             void *abortCheckCbkData
++             POPPLER_CHECK_PAGE_SLICE_ANNOT_CBK POPPLER_CHECK_PAGE_SLICE_ANNOT_CBK_DATA)
+ {
+     this->page = page;
+     return gTrue;
+@@ -487,7 +488,7 @@ void InfoOutputDev::endPage()
+     if(num_chars) 
+       average_char_size /= num_chars;
+ }
+-void InfoOutputDev::drawLink(Link *link, Catalog *catalog) 
++void InfoOutputDev::processLink(Link *link)
+ {
+     num_links++;
+ }
+@@ -568,11 +569,14 @@ void InfoOutputDev::updateFont(GfxState *state)
+       current_splash_font = 0;
+       return;
+     }
+-    GfxState* state2 = state->copy();
++    GfxState* state2 = state->copy(POPPLER_COPY_STATE_PATH);
+     state2->setPath(0);
+     state2->setCTM(1.0,0,0,1.0,0,0);
+     splash->updateCTM(state2, 0,0,0,0,0,0);
+     state2->setTextMat(1.0,0,0,1.0,0,0);
++#ifdef HAVE_POPPLER
++    font->incRefCnt();
++#endif
+     state2->setFont(font, 1024.0);
+     splash->doUpdateFont(state2);
+@@ -693,8 +697,12 @@ FontInfo* InfoOutputDev::getOrCreateFontInfo(GfxState*state)
+       fontinfo->font = font;
+       fontinfo->max_size = 0;
+       if(current_splash_font) {
++#ifdef HAVE_POPPLER
++            fontinfo->ascender = fontinfo->descender = 0;
++#else
+           fontinfo->ascender = current_splash_font->ascender;
+           fontinfo->descender = current_splash_font->descender;
++#endif
+       } else {
+           fontinfo->ascender = fontinfo->descender = 0;
+       }
+@@ -778,9 +786,15 @@ void InfoOutputDev::drawChar(GfxState *state, double x, double y,
+     if(!g) {
+       g = fontinfo->glyphs[code] = new GlyphInfo();
+       g->advance_max = 0;
++#ifndef HAVE_POPPLER
+       current_splash_font->last_advance = -1;
++#endif
+       g->path = current_splash_font->getGlyphPath(code);
++#ifdef HAVE_POPPLER
++        g->advance = -1;
++#else
+       g->advance = current_splash_font->last_advance;
++#endif
+       g->unicode = 0;
+     }
+     if(uLen && ((u[0]>=32 && u[0]<g->unicode) || !g->unicode)) {
+diff --git a/lib/pdf/InfoOutputDev.h b/lib/pdf/InfoOutputDev.h
+index 07fd2e7..d423589 100644
+--- a/lib/pdf/InfoOutputDev.h
++++ b/lib/pdf/InfoOutputDev.h
+@@ -24,7 +24,7 @@
+ #include "popplercompat.h"
+ #include "GfxFont.h"
+ #include "OutputDev.h"
+-#include "SplashOutputDev.h"
++#include "GFXSplashOutputDev.h"
+ #include "Page.h"
+ #ifdef HAVE_POPPLER
+@@ -116,7 +116,7 @@ extern gfxmatrix_t gfxmatrix_from_state(GfxState*state);
+ class InfoOutputDev: public OutputDev 
+ {
+     GlyphInfo* currentglyph;
+-    SplashOutputDev*splash;
++    GFXSplashOutputDev*splash;
+     char previous_was_char;
+     Page *page;
+@@ -140,7 +140,7 @@ class InfoOutputDev: public OutputDev
+     void dumpfonts(gfxdevice_t*dev);
+     FontInfo* getFontInfo(GfxState*state);
+-    InfoOutputDev(XRef*xref);
++    InfoOutputDev(PDFDoc*doc);
+     virtual ~InfoOutputDev(); 
+     virtual GBool useTilingPatternFill();
+     virtual GBool upsideDown();
+@@ -150,12 +150,15 @@ class InfoOutputDev: public OutputDev
+     virtual GBool checkPageSlice(Page *page, double hDPI, double vDPI,
+                              int rotate, GBool useMediaBox, GBool crop,
+                              int sliceX, int sliceY, int sliceW, int sliceH,
+-                             GBool printing, Catalog *catalog,
++                             GBool printing,
+                              GBool (*abortCheckCbk)(void *data) = NULL,
+-                             void *abortCheckCbkData = NULL);
++                               void *abortCheckCbkData = NULL
++                               POPPLER_CHECK_PAGE_SLICE_ANNOT_CBK_H
++                               POPPLER_CHECK_PAGE_SLICE_ANNOT_CBK_DATA_H);
++
+     virtual void startPage(int pageNum, GfxState *state);
+     virtual void endPage();
+-    virtual void drawLink(Link *link, Catalog *catalog);
++    virtual void processLink(Link *link);
+     virtual void updateFont(GfxState *state);
+   
+     virtual void saveState(GfxState *state);
+diff --git a/lib/pdf/Makefile.in b/lib/pdf/Makefile.in
+index 77ff347..45232b8 100644
+--- a/lib/pdf/Makefile.in
++++ b/lib/pdf/Makefile.in
+@@ -15,7 +15,7 @@ libgfxpdf_objects = VectorGraphicOutputDev.$(O) BitmapOutputDev.$(O) FullBitmapO
+ xpdf_in_source = @xpdf_in_source@
+ xpdf_objects =  xpdf/GHash.$(O) xpdf/GList.$(O) xpdf/GString.$(O) xpdf/gmem.$(O) xpdf/gfile.$(O) \
+-                xpdf/FoFiTrueType.$(O) xpdf/FoFiType1.$(O) xpdf/FoFiType1C.$(O) xpdf/FoFiBase.$(O) xpdf/FoFiEncodings.$(O) \
++                xpdf/FoFiTrueType.$(O) xpdf/FoFiType1.$(O) xpdf/FoFiType1C.$(O) xpdf/FoFiBase.$(O) xpdf/FoFiEncodings.$(O) xpdf/FoFiIdentifier.$(O) \
+                 xpdf/OutputDev.$(O) xpdf/PDFDoc.$(O) xpdf/Error.$(O) xpdf/Stream.$(O) xpdf/Object.$(O) \
+                 xpdf/Decrypt.$(O) xpdf/Array.$(O) xpdf/XRef.$(O) xpdf/Dict.$(O) xpdf/Parser.$(O) \
+                 xpdf/Lexer.$(O) xpdf/Outline.$(O) xpdf/PDFDocEncoding.$(O) xpdf/Catalog.$(O) \
+@@ -23,7 +23,7 @@ xpdf_objects =  xpdf/GHash.$(O) xpdf/GList.$(O) xpdf/GString.$(O) xpdf/gmem.$(O)
+                 xpdf/JArithmeticDecoder.$(O) xpdf/Gfx.$(O) xpdf/GfxFont.$(O) xpdf/CMap.$(O) xpdf/CharCodeToUnicode.$(O) \
+                 xpdf/PSTokenizer.$(O) xpdf/FontEncodingTables.$(O) xpdf/BuiltinFont.$(O) xpdf/BuiltinFontTables.$(O) \
+                 xpdf/GfxState.$(O) xpdf/Function.$(O) xpdf/Annot.$(O) xpdf/NameToCharCode.$(O) xpdf/UnicodeMap.$(O) \
+-                xpdf/SecurityHandler.$(O) xpdf/TextOutputDev.$(O) xpdf/UnicodeTypeTable.$(O)
++                xpdf/SecurityHandler.$(O) xpdf/TextOutputDev.$(O) xpdf/UnicodeTypeTable.$(O) xpdf/OptionalContent.$(O)
+                 #xpdf/OptionalContent.$(O)
+ splash_in_source = @splash_in_source@
+@@ -49,9 +49,9 @@ VectorGraphicOutputDev.$(O): VectorGraphicOutputDev.cc VectorGraphicOutputDev.h
+       $(CC) -I ./ $(xpdf_include) VectorGraphicOutputDev.cc -o $@
+ CharOutputDev.$(O): CharOutputDev.cc CharOutputDev.h CommonOutputDev.h InfoOutputDev.h ../gfxpoly.h
+       $(CC) -I ./ $(xpdf_include) CharOutputDev.cc -o $@
+-InfoOutputDev.$(O): InfoOutputDev.cc InfoOutputDev.h
++InfoOutputDev.$(O): InfoOutputDev.cc InfoOutputDev.h GFXSplashOutputDev.h
+       $(CC) -I ./ $(xpdf_include) InfoOutputDev.cc -o $@
+-BitmapOutputDev.$(O): BitmapOutputDev.cc BitmapOutputDev.h CommonOutputDev.h InfoOutputDev.h
++BitmapOutputDev.$(O): BitmapOutputDev.cc BitmapOutputDev.h CommonOutputDev.h InfoOutputDev.h GFXSplashOutputDev.h
+       $(CC) -I ./ $(xpdf_include) BitmapOutputDev.cc -o $@
+ XMLOutputDev.$(O): XMLOutputDev.cc XMLOutputDev.h xpdf/TextOutputDev.h
+       $(CC) -I ./ $(xpdf_include) XMLOutputDev.cc -o $@
+@@ -65,8 +65,8 @@ pdf.$(O): pdf.cc VectorGraphicOutputDev.h CharOutputDev.h InfoOutputDev.h Common
+ XPDFOK = xpdf/Gfx.cc
+ ifeq ($(shell echo inject*xpdf.pl),inject-xpdf.pl)
+ $(XPDFOK): Makefile.in inject-xpdf.pl xpdf-*tar.gz xpdf*patch
+-      @if test xpdf-changes.patch -nt $(XPDFOK);then perl inject-xpdf.pl xpdf-3.02.tar.gz;fi
+-      @if test '!' -d xpdf;then perl inject-xpdf.pl xpdf-3.02.tar.gz;fi
++      @if test xpdf-changes.patch -nt $(XPDFOK);then perl inject-xpdf.pl xpdf-3.03.tar.gz;fi
++      @if test '!' -d xpdf;then perl inject-xpdf.pl xpdf-3.03.tar.gz;fi
+ endif
+ xpdf/UnicodeMap.$(O): xpdf/UnicodeMap.cc
+@@ -131,6 +131,8 @@ xpdf/Error.$(O): xpdf/Error.cc aconf.h
+       $(CC) -I ./ -I xpdf xpdf/Error.cc -o $@
+ xpdf/Stream.$(O): xpdf/Stream.cc
+       $(CC) -I ./ -I xpdf xpdf/Stream.cc -o $@
++xpdf/OptionalContent.$(O): xpdf/OptionalContent.cc
++      $(CC) -I ./ -I xpdf xpdf/OptionalContent.cc -o $@
+ xpdf/PDFDoc.$(O): xpdf/PDFDoc.cc
+       $(CC) -I ./ -I xpdf xpdf/PDFDoc.cc -o $@
+ xpdf/SecurityHandler.$(O): xpdf/SecurityHandler.cc xpdf/SecurityHandler.h
+@@ -147,6 +149,8 @@ xpdf/FoFiType1C.$(O): xpdf/FoFiType1C.cc xpdf/FoFiBase.h
+       $(CC) -I ./ -I xpdf xpdf/FoFiType1C.cc -o $@
+ xpdf/FoFiType1.$(O): xpdf/FoFiType1.cc xpdf/FoFiBase.h
+       $(CC) -I ./ -I xpdf xpdf/FoFiType1.cc -o $@
++xpdf/FoFiIdentifier.$(O): xpdf/FoFiIdentifier.cc
++      $(CC) -I ./ -I xpdf xpdf/FoFiIdentifier.cc -o $@
+ xpdf/GList.$(O): xpdf/GList.cc
+       $(CC) -I ./ -I xpdf xpdf/GList.cc -o $@
+ xpdf/GString.$(O): xpdf/GString.cc
+diff --git a/lib/pdf/VectorGraphicOutputDev.cc b/lib/pdf/VectorGraphicOutputDev.cc
+index 9194a02..abade59 100644
+--- a/lib/pdf/VectorGraphicOutputDev.cc
++++ b/lib/pdf/VectorGraphicOutputDev.cc
+@@ -262,7 +262,7 @@ GBool VectorGraphicOutputDev::useTilingPatternFill()
+         return gTrue;
+     return gFalse;
+ }
+-GBool VectorGraphicOutputDev::useShadedFills()
++GBool VectorGraphicOutputDev::useShadedFills(POPPLER_SHADED_FILL_TYPE)
+ {
+     infofeature("shaded fills");
+     if(config_convertgradients)
+@@ -271,9 +271,11 @@ GBool VectorGraphicOutputDev::useShadedFills()
+ }
+ POPPLER_TILING_PATERN_RETURN VectorGraphicOutputDev::tilingPatternFill(GfxState *state,
+-                             POPPLER_TILING_PATERN_GFX
++                               Gfx *gfx,
++                               POPPLER_TILING_PATTERN_CATALOG
+                              Object *str,
+-                             int paintType, Dict *resDict,
++                               POPPLER_TILING_PATTERN_PMAT
++                             int paintType, POPPLER_TILING_PATTERN_TILING_TYPE Dict *resDict,
+                              double *mat, double *bbox,
+                              int x0, int y0, int x1, int y1,
+                              double xStep, double yStep) 
+@@ -680,9 +682,9 @@ void VectorGraphicOutputDev::updateFont(GfxState*state)
+     charDev->updateFont(state);
+ }
+-void VectorGraphicOutputDev::processLink(Link *link, Catalog *catalog)
++void VectorGraphicOutputDev::processLink(Link *link)
+ {
+-    charDev->processLink(link, catalog);
++    charDev->processLink(link);
+ }
+ void VectorGraphicOutputDev::beginString(GfxState *state, GString *s) 
+@@ -837,9 +839,10 @@ void VectorGraphicOutputDev::endType3Char(GfxState *state)
+ GBool VectorGraphicOutputDev::checkPageSlice(Page *page, double hDPI, double vDPI,
+                          int rotate, GBool useMediaBox, GBool crop,
+                          int sliceX, int sliceY, int sliceW, int sliceH,
+-                         GBool printing, Catalog *catalog,
++                         GBool printing,
+                          GBool (*abortCheckCbk)(void *data),
+-                         void *abortCheckCbkData)
++                         void *abortCheckCbkData
++                           POPPLER_CHECK_PAGE_SLICE_ANNOT_CBK POPPLER_CHECK_PAGE_SLICE_ANNOT_CBK_DATA)
+ {
+     this->setPage(page);
+     charDev->setPage(page);
+@@ -1362,11 +1365,11 @@ void VectorGraphicOutputDev::drawGeneralImage(GfxState *state, Object *ref, Stre
+ }
+ void VectorGraphicOutputDev::drawImageMask(GfxState *state, Object *ref, Stream *str,
+-                                 int width, int height, GBool invert,
++                                 int width, int height, GBool invert, POPPLER_INTERPOLATE
+                                  GBool inlineImg) 
+ {
+     if(config_textonly) {
+-      OutputDev::drawImageMask(state,ref,str,width,height,invert,inlineImg);
++        OutputDev::drawImageMask(state,ref,str,width,height,invert,POPPLER_INTERPOLATE_ARG inlineImg);
+       return;
+     }
+     dbg("drawImageMask %dx%d, invert=%d inline=%d", width, height, invert, inlineImg);
+@@ -1375,11 +1378,11 @@ void VectorGraphicOutputDev::drawImageMask(GfxState *state, Object *ref, Stream
+ }
+ void VectorGraphicOutputDev::drawImage(GfxState *state, Object *ref, Stream *str,
+-                       int width, int height, GfxImageColorMap *colorMap,
++                       int width, int height, GfxImageColorMap *colorMap, POPPLER_INTERPOLATE
+                        int *maskColors, GBool inlineImg)
+ {
+     if(config_textonly) {
+-      OutputDev::drawImage(state,ref,str,width,height,colorMap,maskColors,inlineImg);
++      OutputDev::drawImage(state,ref,str,width,height,colorMap,POPPLER_INTERPOLATE_ARG maskColors,inlineImg);
+       return;
+     }
+     dbg("drawImage %dx%d, %s, %s, inline=%d", width, height, 
+@@ -1398,12 +1401,12 @@ void VectorGraphicOutputDev::drawImage(GfxState *state, Object *ref, Stream *str
+   
+ void VectorGraphicOutputDev::drawMaskedImage(GfxState *state, Object *ref, Stream *str,
+                              int width, int height,
+-                             GfxImageColorMap *colorMap,
++                             GfxImageColorMap *colorMap, POPPLER_INTERPOLATE
+                              Stream *maskStr, int maskWidth, int maskHeight,
+-                             GBool maskInvert)
++                             GBool maskInvert POPPLER_MASK_INTERPOLATE)
+ {
+     if(config_textonly) {
+-      OutputDev::drawMaskedImage(state,ref,str,width,height,colorMap,maskStr,maskWidth,maskHeight,maskInvert);
++      OutputDev::drawMaskedImage(state,ref,str,width,height,colorMap,POPPLER_INTERPOLATE_ARG maskStr,maskWidth,maskHeight,maskInvert POPPLER_MASK_INTERPOLATE_ARG);
+       return;
+     }
+     dbg("drawMaskedImage %dx%d, %s, %dx%d mask", width, height, 
+@@ -1420,13 +1423,13 @@ void VectorGraphicOutputDev::drawMaskedImage(GfxState *state, Object *ref, Strea
+ void VectorGraphicOutputDev::drawSoftMaskedImage(GfxState *state, Object *ref, Stream *str,
+                                  int width, int height,
+-                                 GfxImageColorMap *colorMap,
++                                 GfxImageColorMap *colorMap, POPPLER_INTERPOLATE
+                                  Stream *maskStr,
+                                  int maskWidth, int maskHeight,
+-                                 GfxImageColorMap *maskColorMap)
++                                 GfxImageColorMap *maskColorMap POPPLER_MASK_INTERPOLATE)
+ {
+     if(config_textonly) {
+-      OutputDev::drawSoftMaskedImage(state,ref,str,width,height,colorMap,maskStr,maskWidth,maskHeight,maskColorMap);
++      OutputDev::drawSoftMaskedImage(state,ref,str,width,height,colorMap,POPPLER_INTERPOLATE_ARG maskStr,maskWidth,maskHeight,maskColorMap POPPLER_MASK_INTERPOLATE_ARG);
+       return;
+     }
+     dbg("drawSoftMaskedImage %dx%d, %s, %dx%d mask", width, height, 
+diff --git a/lib/pdf/VectorGraphicOutputDev.h b/lib/pdf/VectorGraphicOutputDev.h
+index 6e530d6..7a1e58f 100644
+--- a/lib/pdf/VectorGraphicOutputDev.h
++++ b/lib/pdf/VectorGraphicOutputDev.h
+@@ -64,9 +64,11 @@ public:
+   virtual GBool checkPageSlice(Page *page, double hDPI, double vDPI,
+                              int rotate, GBool useMediaBox, GBool crop,
+                              int sliceX, int sliceY, int sliceW, int sliceH,
+-                             GBool printing, Catalog *catalog,
++                             GBool printing,
+                              GBool (*abortCheckCbk)(void *data) = NULL,
+-                             void *abortCheckCbkData = NULL);
++                             void *abortCheckCbkData = NULL
++                               POPPLER_CHECK_PAGE_SLICE_ANNOT_CBK_H
++                               POPPLER_CHECK_PAGE_SLICE_ANNOT_CBK_DATA_H);
+   //----- get info about output device
+   // Does this device use upside-down coordinates?
+@@ -79,7 +81,7 @@ public:
+   //virtual GBool useShadedFills() { return gTrue; }
+   //----- link borders
+-  virtual void processLink(Link *link, Catalog *catalog);
++  virtual void processLink(Link *link);
+   virtual void setDefaultCTM(double *ctm);
+   //----- save/restore graphics state
+@@ -103,12 +105,14 @@ public:
+   
+   //----- shaded fills
+   virtual GBool useTilingPatternFill();
+-  virtual GBool useShadedFills();
++  virtual GBool useShadedFills(POPPLER_SHADED_FILL_TYPE);
+ virtual POPPLER_TILING_PATERN_RETURN tilingPatternFill(GfxState *state,
+-                           POPPLER_TILING_PATERN_GFX
++                             Gfx *gfx,
++                             POPPLER_TILING_PATTERN_CATALOG
+                            Object *str,
+-                           int paintType, Dict *resDict,
++                             POPPLER_TILING_PATTERN_PMAT
++                           int paintType, POPPLER_TILING_PATTERN_TILING_TYPE Dict *resDict,
+                            double *mat, double *bbox,
+                            int x0, int y0, int x1, int y1,
+                            double xStep, double yStep);
+@@ -128,22 +132,22 @@ virtual POPPLER_TILING_PATERN_RETURN tilingPatternFill(GfxState *state,
+   //----- image drawing
+   virtual void drawImageMask(GfxState *state, Object *ref, Stream *str,
+-                           int width, int height, GBool invert,
++                           int width, int height, GBool invert, POPPLER_INTERPOLATE
+                            GBool inlineImg);
+   virtual void drawImage(GfxState *state, Object *ref, Stream *str,
+-                       int width, int height, GfxImageColorMap *colorMap,
++                       int width, int height, GfxImageColorMap *colorMap, POPPLER_INTERPOLATE
+                        int *maskColors, GBool inlineImg);
+   virtual void drawMaskedImage(GfxState *state, Object *ref, Stream *str,
+                              int width, int height,
+-                             GfxImageColorMap *colorMap,
++                             GfxImageColorMap *colorMap, POPPLER_INTERPOLATE
+                              Stream *maskStr, int maskWidth, int maskHeight,
+-                             GBool maskInvert);
++                             GBool maskInvert POPPLER_MASK_INTERPOLATE);
+   virtual void drawSoftMaskedImage(GfxState *state, Object *ref, Stream *str,
+                                  int width, int height,
+-                                 GfxImageColorMap *colorMap,
++                                 GfxImageColorMap *colorMap, POPPLER_INTERPOLATE
+                                  Stream *maskStr,
+                                  int maskWidth, int maskHeight,
+-                                 GfxImageColorMap *maskColorMap);
++                                 GfxImageColorMap *maskColorMap POPPLER_MASK_INTERPOLATE);
+   //----- transparency groups and soft masks (xpdf >= ~ 3.01.16)
+   virtual void beginTransparencyGroup(GfxState *state, double *bbox,
+diff --git a/lib/pdf/XMLOutputDev.cc b/lib/pdf/XMLOutputDev.cc
+index 06aad02..fb3aee1 100644
+--- a/lib/pdf/XMLOutputDev.cc
++++ b/lib/pdf/XMLOutputDev.cc
+@@ -27,7 +27,7 @@
+ #endif
+ XMLOutputDev::XMLOutputDev(char*filename)
+-:TextOutputDev(mktmpname(0), false, false, false)
++:TextOutputDev(mktmpname(0), false, 0, false, false)
+ {
+   out = fopen(filename, "wb");
+   if(!out) {
+#diff --git a/lib/pdf/inject-xpdf.pl b/lib/pdf/inject-xpdf.pl
+#index 386dc12..f0e2fc1 100755
+#--- a/lib/pdf/inject-xpdf.pl
+#+++ b/lib/pdf/inject-xpdf.pl
+#@@ -59,7 +59,7 @@ fi
+# if test "x\$VERSION" = "xstable";then
+#     echo "Switching to stable version"
+#     rm -f xpdf
+#-    ln -s xpdf-3.02 xpdf
+#+    ln -s xpdf-3.03 xpdf
+# elif test "x\$VERSION" = "xlatest";then
+#     echo "Switching to latest version"
+#     rm -f xpdf
+diff --git a/lib/pdf/pdf.cc b/lib/pdf/pdf.cc
+index 1e668a0..61165fb 100644
+--- a/lib/pdf/pdf.cc
++++ b/lib/pdf/pdf.cc
+@@ -16,6 +16,7 @@
+ #include "FullBitmapOutputDev.h"
+ #include "BitmapOutputDev.h"
+ #include "VectorGraphicOutputDev.h"
++#include "popplercompat.h"
+ #include "../mem.h"
+ #include "pdf.h"
+ #define NO_ARGPARSER
+@@ -533,7 +534,7 @@ static gfxdocument_t*pdf_open(gfxsource_t*src, const char*filename)
+       msg("<notice> Rendering at %f DPI. (Page width at 72 DPI: %f, target width: %d)", zoom, width_before, zoomtowidth);
+     }
+-    i->info = new InfoOutputDev(i->doc->getXRef());
++    i->info = new InfoOutputDev(i->doc);
+     int t;
+     i->pages = (pdf_page_info_t*)malloc(sizeof(pdf_page_info_t)*pdf_doc->num_pages);
+     memset(i->pages,0,sizeof(pdf_page_info_t)*pdf_doc->num_pages);
+diff --git a/lib/pdf/popplercompat.h b/lib/pdf/popplercompat.h
+index 8303369..9727733 100644
+--- a/lib/pdf/popplercompat.h
++++ b/lib/pdf/popplercompat.h
+@@ -17,17 +17,8 @@
+ #ifdef HAVE_POPPLER
+   #define POPPLER_TILING_PATERN_RETURN GBool
+-  #define POPPLER_TILING_PATERN_GFX
+-  #define POPPLER_TILING_PATERN_GFX_ARG
+ #else
+   #define POPPLER_TILING_PATERN_RETURN void
+-  #if (xpdfMajorVersion*10000 + xpdfMinorVersion*100 + xpdfUpdateVersion) < 30207
+-    #define POPPLER_TILING_PATERN_GFX
+-    #define POPPLER_TILING_PATERN_GFX_ARG
+-  #else
+-    #define POPPLER_TILING_PATERN_GFX Gfx *gfx,
+-    #define POPPLER_TILING_PATERN_GFX_ARG gfx,
+-  #endif
+ #endif
+ #ifdef HAVE_POPPLER
+@@ -43,6 +34,74 @@ char* mktmpname(char*ptr);
+ #endif
+ #ifdef HAVE_POPPLER
++#define AnnotLink Link
++#endif
++
++#ifdef HAVE_POPPLER
++  #define POPPLER_STARTDOC_ARG this->doc
++  #define INFO_OUTPUT_DEV_STARTDOC_ARG doc
++#else
++  #define POPPLER_STARTDOC_ARG this->xref
++  #define INFO_OUTPUT_DEV_STARTDOC_ARG doc->getXRef()
++#endif
++
++#ifdef HAVE_POPPLER
++  #define POPPLER_SHADED_FILL_TYPE int type
++  #define POPPLER_SHADED_FILL_TYPE_ARG type
++#else
++  #define POPPLER_SHADED_FILL_TYPE
++  #define POPPLER_SHADED_FILL_TYPE_ARG
++#endif
++
++#ifdef HAVE_POPPLER
++  #define POPPLER_TILING_PATTERN_CATALOG Catalog *cat,
++  #define POPPLER_TILING_PATTERN_CATALOG_ARG cat,
++  #define POPPLER_TILING_PATTERN_PMAT double *pmat,
++  #define POPPLER_TILING_PATTERN_PMAT_ARG pmat,
++  #define POPPLER_TILING_PATTERN_TILING_TYPE int tilingType,
++  #define POPPLER_TILING_PATTERN_TILING_TYPE_ARG tilingType,
++#else
++  #define POPPLER_TILING_PATTERN_CATALOG
++  #define POPPLER_TILING_PATTERN_CATALOG_ARG
++  #define POPPLER_TILING_PATTERN_PMAT
++  #define POPPLER_TILING_PATTERN_PMAT_ARG
++  #define POPPLER_TILING_PATTERN_TILING_TYPE
++  #define POPPLER_TILING_PATTERN_TILING_TYPE_ARG
++#endif
++
++#ifdef HAVE_POPPLER
++  #define POPPLER_GET_GLYPH_ARGS , x0, y0, &clip, &clipRes
++#else
++  #define POPPLER_GET_GLYPH_ARGS
++#endif
++
++#ifndef HAVE_POPPLER
++  #define GFXSplashOutputDev SplashOutputDev
++#endif
++
++#ifdef HAVE_POPPLER
++  #define POPPLER_CHECK_PAGE_SLICE_ANNOT_CBK_H , GBool (*annotDisplayDecideCbk)(Annot *annot, void *user_data) = NULL
++  #define POPPLER_CHECK_PAGE_SLICE_ANNOT_CBK , GBool (*annotDisplayDecideCbk)(Annot *annot, void *user_data)
++  #define POPPLER_CHECK_PAGE_SLICE_ANNOT_CBK_DATA_H , void *annotDisplayDecideCbkData = NULL
++  #define POPPLER_CHECK_PAGE_SLICE_ANNOT_CBK_DATA , void *annotDisplayDecideCbkData
++#else
++  #define POPPLER_CHECK_PAGE_SLICE_ANNOT_CBK_H
++  #define POPPLER_CHECK_PAGE_SLICE_ANNOT_CBK
++  #define POPPLER_CHECK_PAGE_SLICE_ANNOT_CBK_DATA_H
++  #define POPPLER_CHECK_PAGE_SLICE_ANNOT_CBK_DATA
++#endif
++
++#ifdef HAVE_POPPLER
++  #define POPPLER_COPY_STATE_PATH gTrue
++#else
++  #define POPPLER_COPY_STATE_PATH gFalse
++#endif
++
++#ifdef HAVE_POPPLER
++  #define GFXGlobalParams GlobalParams
++#endif
++
++#ifdef HAVE_POPPLER
+   #include <goo/GooString.h>
+   #include <goo/gfile.h>
+ #else
+#diff --git a/lib/pdf/xpdf-3.02.tar.gz b/lib/pdf/xpdf-3.02.tar.gz
+#deleted file mode 100644
+#index 1411a87..0000000
+#Binary files a/lib/pdf/xpdf-3.02.tar.gz and /dev/null differ
+#diff --git a/lib/pdf/xpdf-3.03.tar.gz b/lib/pdf/xpdf-3.03.tar.gz
+#new file mode 100644
+#index 0000000..488e9bd
+#Binary files /dev/null and b/lib/pdf/xpdf-3.03.tar.gz differ
+#diff --git a/lib/pdf/xpdf-changes.patch b/lib/pdf/xpdf-changes.patch
+#index 23d19a4..ca547b7 100644
+#--- a/lib/pdf/xpdf-changes.patch
+#+++ b/lib/pdf/xpdf-changes.patch
+# *** deleted ***
diff --git a/swftools-poppler2.patch b/swftools-poppler2.patch
new file mode 100644 (file)
index 0000000..f308a1e
--- /dev/null
@@ -0,0 +1,70 @@
+--- swftools-0.9.2/lib/pdf/BitmapOutputDev.cc.orig     2014-06-21 08:53:04.062950171 +0200
++++ swftools-0.9.2/lib/pdf/BitmapOutputDev.cc  2014-06-21 09:14:39.449589839 +0200
+@@ -998,11 +998,11 @@
+ void BitmapOutputDev::beginPage(GfxState *state, int pageNum)
+ {
+-    rgbdev->startPage(pageNum, state);
+-    boolpolydev->startPage(pageNum, state);
+-    booltextdev->startPage(pageNum, state);
+-    clip0dev->startPage(pageNum, state);
+-    clip1dev->startPage(pageNum, state);
++    rgbdev->startPage(pageNum, state, NULL);
++    boolpolydev->startPage(pageNum, state, NULL);
++    booltextdev->startPage(pageNum, state, NULL);
++    clip0dev->startPage(pageNum, state, NULL);
++    clip1dev->startPage(pageNum, state, NULL);
+     gfxdev->startPage(pageNum, state);
+     boolpolybitmap = boolpolydev->getBitmap();
+--- swftools-0.9.2/lib/pdf/FullBitmapOutputDev.cc.orig 2014-06-21 08:53:04.066283501 +0200
++++ swftools-0.9.2/lib/pdf/FullBitmapOutputDev.cc      2014-06-21 09:15:29.096255472 +0200
+@@ -192,7 +192,7 @@
+ void FullBitmapOutputDev::beginPage(GfxState *state, int pageNum)
+ {
+     msg("<debug> startPage");
+-    rgbdev->startPage(pageNum, state);
++    rgbdev->startPage(pageNum, state, NULL);
+     gfxdev->startPage(pageNum, state);
+ }
+--- swftools-0.9.2/lib/pdf/XMLOutputDev.cc.orig        2014-06-21 08:53:04.072950171 +0200
++++ swftools-0.9.2/lib/pdf/XMLOutputDev.cc     2014-06-21 09:31:00.109569398 +0200
+@@ -46,7 +46,7 @@
+ void XMLOutputDev::startPage(int pageNum, GfxState *state)
+ {
+-    TextOutputDev::startPage(pageNum, state);
++    TextOutputDev::startPage(pageNum, state, NULL);
+     fprintf(out, "<page nr=\"%d\" width=\"%.0f\" height=\"%.0f\">\n", pageNum,
+       state->getPageWidth(), state->getPageHeight());
+ }
+@@ -67,7 +67,7 @@
+     double color_b = -1;
+     for(i=0;i<len;i++) {
+       TextWord*word = list->get(i);
+-      GString*newfont = word->getFontName();
++      GString*newfont = word->getFontName(0);
+       double newsize = word->getFontSize();
+ #ifdef HAVE_POPPLER
+       double newbase = word->getBaseline();
+@@ -87,7 +87,7 @@
+          newcolor_b != color_b
+          ) 
+       {
+-          TextFontInfo*info = word->getFontInfo();
++          TextFontInfo*info = word->getFontInfo(0);
+           if(textTag)
+               fprintf(out, "</t>\n");
+           textTag = 1;
+--- swftools-0.9.2/lib/pdf/pdf.cc.orig 2014-06-21 10:48:46.916138792 +0200
++++ swftools-0.9.2/lib/pdf/pdf.cc      2014-06-21 10:48:54.919471960 +0200
+@@ -375,7 +375,7 @@
+     else if(!strcmp(name, "creationdate")) return getInfoDate(i->docinfo.getDict(), "CreationDate");
+     else if(!strcmp(name, "moddate")) return getInfoDate(i->docinfo.getDict(), "ModDate");
+     else if(!strcmp(name, "linearized")) return strdup(i->doc->isLinearized() ? "yes" : "no");
+-    else if(!strcmp(name, "tagged")) return strdup(i->doc->getStructTreeRoot()->isDict() ? "yes" : "no");
++    else if(!strcmp(name, "tagged")) return strdup((i->doc->getCatalog()->getMarkInfo() & Catalog::markInfoMarked) ? "yes" : "no");
+     else if(!strcmp(name, "encrypted")) return strdup(i->doc->isEncrypted() ? "yes" : "no");
+     else if(!strcmp(name, "oktoprint")) return strdup(i->doc->okToPrint() ? "yes" : "no");
+     else if(!strcmp(name, "oktocopy")) return strdup(i->doc->okToCopy() ? "yes" : "no");
index 4ebc9e3e017b2532160bc56260822aa78815a849..f3ac7494e89364c4cc19fb14e628cbf2ee5a72cc 100644 (file)
@@ -1,25 +1,32 @@
 Summary:       Utilities for SWF files manipulation
 Summary(pl.UTF-8):     Narzędzia do manipulacji na plikach SWF
 Name:          swftools
-Version:       0.9.1
-Release:       2
-License:       GPL
+Version:       0.9.2
+Release:       1
+License:       GPL v2+
 Group:         Applications/Graphics
+#Source0Download: http://www.swftools.org/download.html
 Source0:       http://www.swftools.org/%{name}-%{version}.tar.gz
-# Source0-md5: 72dc4a7bf5cdf98c28f9cf9b1d8f5d7a
+# Source0-md5: 1055ebbe3b4cadcc71e83775a5a0906d
 Patch0:                %{name}-swfstrings-print_unknown_chars.patch
 Patch1:                %{name}-missing-m4.patch
+Patch2:                %{name}-giflib.patch
+Patch3:                %{name}-poppler.patch
+Patch4:                %{name}-poppler2.patch
+Patch5:                %{name}-install.patch
 URL:           http://www.swftools.org/
 BuildRequires: autoconf
 BuildRequires: automake
 BuildRequires: fftw3-devel
 BuildRequires: fontconfig-devel
 BuildRequires: freetype-devel
-BuildRequires: giflib-devel
+BuildRequires: giflib-devel >= 5.1
 BuildRequires: lame-libs-devel
 BuildRequires: libjpeg-devel
 BuildRequires: libstdc++-devel
 BuildRequires: libtool
+BuildRequires: poppler-devel
+BuildRequires: t1lib-devel >= 5.0.1
 BuildRequires: zlib-devel
 BuildRequires: zziplib-devel
 Requires:      fonts-Type1-urw
@@ -36,6 +43,10 @@ Narzędzia do manipulacji na plikach SWF.
 %setup -q
 %patch0 -p1
 %patch1 -p1
+%patch2 -p1
+%patch3 -p1
+%patch4 -p1
+%patch5 -p1
 
 %build
 %{__libtoolize}
@@ -43,7 +54,9 @@ Narzędzia do manipulacji na plikach SWF.
 %{__autoconf}
 %configure \
        ac_cv_header_pdflib_h=no \
-       AVIFILE_CONFIG=x
+       AVIFILE_CONFIG=x \
+       POPPLER_CFLAGS="-I/usr/include/poppler" \
+       --enable-poppler
 
 %{__make}
 
@@ -56,14 +69,6 @@ rm -rf $RPM_BUILD_ROOT
        mandir=$RPM_BUILD_ROOT%{_mandir} \
        datadir=$RPM_BUILD_ROOT%{_datadir}
 
-# fix broken .swf symlinks
-rm -f $RPM_BUILD_ROOT%{_datadir}/swftools/swfs/default_*
-ln -sf tessel_loader.swf $RPM_BUILD_ROOT%{_datadir}/swftools/swfs/default_loader.swf
-ln -sf simple_viewer.swf $RPM_BUILD_ROOT%{_datadir}/swftools/swfs/default_viewer.swf
-
-# no -devel package, shut up check-files
-rm -f $RPM_BUILD_ROOT%{_libdir}/lib*.{la,so}
-
 %clean
 rm -rf $RPM_BUILD_ROOT
 
This page took 0.126291 seconds and 4 git commands to generate.