xpdf-3.02 fixes
authorkramm <kramm>
Sun, 18 Mar 2007 18:24:32 +0000 (18:24 +0000)
committerkramm <kramm>
Sun, 18 Mar 2007 18:24:32 +0000 (18:24 +0000)
lib/pdf/GFXOutputDev.cc
lib/pdf/GFXOutputDev.h
lib/pdf/Makefile.in
lib/pdf/inject-xpdf.pl
lib/pdf/pdf.cc
lib/pdf/xpdf-changes.patch

index fdc6b2b..df8f27f 100644 (file)
@@ -1200,11 +1200,8 @@ void GFXOutputDev::startPage(int pageNum, GfxState *state, double crop_x1, doubl
     device->fill(device, clippath, &white);
 }
 
     device->fill(device, clippath, &white);
 }
 
-#if xpdfUpdateVersion >= 16
+
 void GFXOutputDev::processLink(Link *link, Catalog *catalog)
 void GFXOutputDev::processLink(Link *link, Catalog *catalog)
-#else
-void GFXOutputDev::drawLink(Link *link, Catalog *catalog) 
-#endif
 {
     double x1, y1, x2, y2, w;
     gfxline_t points[5];
 {
     double x1, y1, x2, y2, w;
     gfxline_t points[5];
@@ -1562,7 +1559,7 @@ char*GFXOutputDev::writeEmbeddedFontToFile(XRef*ref, GfxFont*font)
       }
       FoFiType1C *cvt = FoFiType1C::make(fontBuf, fontLen);
       if(!cvt) return 0;
       }
       FoFiType1C *cvt = FoFiType1C::make(fontBuf, fontLen);
       if(!cvt) return 0;
-      cvt->convertToType1(NULL, gTrue, FoFiWrite, f);
+      cvt->convertToType1(0, NULL, gTrue, FoFiWrite, f);
       //cvt->convertToCIDType0("test", f);
       //cvt->convertToType0("test", f);
       delete cvt;
       //cvt->convertToCIDType0("test", f);
       //cvt->convertToType0("test", f);
       delete cvt;
index c622ee0..55d3084 100644 (file)
@@ -83,11 +83,7 @@ public:
   void setXRef(PDFDoc*doc, XRef *xref);
 
   //----- link borders
   void setXRef(PDFDoc*doc, XRef *xref);
 
   //----- link borders
-#if xpdfUpdateVersion >= 16
   virtual void processLink(Link *link, Catalog *catalog);
   virtual void processLink(Link *link, Catalog *catalog);
-#else
-  virtual void drawLink(Link *link, Catalog *catalog);
-#endif
 
   //----- save/restore graphics state
   virtual void saveState(GfxState *state) ;
 
   //----- save/restore graphics state
   virtual void saveState(GfxState *state) ;
index a4f4e26..9db3112 100644 (file)
@@ -116,8 +116,8 @@ xpdf/GHash.$(O): xpdf/GHash.cc
        $(CC) -I ./ -I xpdf xpdf/GHash.cc -o $@
 xpdf/gfile.$(O): xpdf/gfile.cc
        $(CC) -I ./ -I xpdf xpdf/gfile.cc -o $@
        $(CC) -I ./ -I xpdf xpdf/GHash.cc -o $@
 xpdf/gfile.$(O): xpdf/gfile.cc
        $(CC) -I ./ -I xpdf xpdf/gfile.cc -o $@
-xpdf/gmem.$(O): xpdf/gmem.c
-       $(C) -I ./ -I xpdf xpdf/gmem.c -o $@
+xpdf/gmem.$(O): xpdf/gmem.cc
+       $(C) -I ./ -I xpdf xpdf/gmem.cc -o $@
 
 ../libpdf$(A): $(libpdf_objects) $(xpdf_objects)
        $(AR) r ../libpdf$(A) $(libpdf_objects) $(xpdf_objects)
 
 ../libpdf$(A): $(libpdf_objects) $(xpdf_objects)
        $(AR) r ../libpdf$(A) $(libpdf_objects) $(xpdf_objects)
index 7a0ea13..045e990 100755 (executable)
@@ -25,11 +25,18 @@ open(fi, ">switch");
 print fi <<EOF
 #!/bin/sh
 
 print fi <<EOF
 #!/bin/sh
 
-if test "x\$1" = "xstable";then
+VERSION=$1
+PS3="choose> "
+
+if test "x$VERSION" = "x";then
+    select V in stable latest;do VERSION="$V";break;done
+fi
+
+if test "x\$VERSION" = "xstable";then
     echo "Switching to stable version"
     rm -f xpdf
     echo "Switching to stable version"
     rm -f xpdf
-    ln -s xpdf-3.01 xpdf
-elif test "x\$1" = "xlatest";then
+    ln -s xpdf-3.02 xpdf
+elif test "x\$VERSION" = "xlatest";then
     echo "Switching to latest version"
     rm -f xpdf
     ln -s $directory xpdf
     echo "Switching to latest version"
     rm -f xpdf
     ln -s $directory xpdf
index 53d95cc..7ba786d 100644 (file)
@@ -87,6 +87,7 @@ void render2(gfxpage_t*page, gfxdevice_t*output)
     pi->outputDev->setInfo(pi->info);
     pi->outputDev->setXRef(pi->doc, pi->doc->getXRef());
     pi->doc->displayPage((OutputDev*)pi->outputDev, page->nr, zoom, zoom, /*rotate*/0, true, true, /*doLinks*/(int)1);
     pi->outputDev->setInfo(pi->info);
     pi->outputDev->setXRef(pi->doc, pi->doc->getXRef());
     pi->doc->displayPage((OutputDev*)pi->outputDev, page->nr, zoom, zoom, /*rotate*/0, true, true, /*doLinks*/(int)1);
+    pi->doc->processLinks((OutputDev*)pi->outputDev, page->nr);
 }
 
     
 }
 
     
index 44c646f..b2b7a92 100644 (file)
@@ -1,24 +1,3 @@
-Index: FoFiType1C.cc
-===================================================================
-RCS file: /home/kramm/cvs/swftools.cache.cvsroot/swftools.cache/pdf2swf/xpdf/FoFiType1C.cc,v
-retrieving revision 1.3
-retrieving revision 1.4
-diff -u -r1.3 -r1.4
---- FoFiType1C.cc      3 Dec 2005 10:11:33 -0000       1.3
-+++ FoFiType1C.cc      3 Dec 2005 10:30:41 -0000       1.4
-@@ -231,8 +231,11 @@
-     (*outputFunc)(outputStream,
-                 "0 1 255 {1 index exch /.notdef put} for\n", 40);
-     enc = newEncoding ? newEncoding : encoding;
-+    if(!enc) {
-+      fprintf(stderr, "convertToType1: Warning: No Encoding\n");
-+    }
-     for (i = 0; i < 256; ++i) {
--      if (enc[i]) {
-+      if (enc && enc[i]) {
-       sprintf(buf, "dup %d /%s put\n", i, enc[i]);
-       (*outputFunc)(outputStream, buf, strlen(buf));
-       }
 Index: Gfx.cc
 ===================================================================
 RCS file: /home/kramm/cvs/swftools.cache.cvsroot/swftools.cache/pdf2swf/xpdf/Gfx.cc,v
 Index: Gfx.cc
 ===================================================================
 RCS file: /home/kramm/cvs/swftools.cache.cvsroot/swftools.cache/pdf2swf/xpdf/Gfx.cc,v