370 lines
14 KiB
Diff
370 lines
14 KiB
Diff
diff -up texlive-2007/configure.in.poppler texlive-2007/configure.in
|
|
--- texlive-2007/configure.in.poppler 2007-01-08 20:17:11.000000000 -0500
|
|
+++ texlive-2007/configure.in 2008-11-11 22:38:31.000000000 -0500
|
|
@@ -157,9 +157,9 @@ export needs_zlib
|
|
|
|
# we need libxpdf for pdf[ex]tex, xetex
|
|
test ! -d $srcdir/$LIBXPDFDIR && : ${needs_libxpdf=no}
|
|
-test "$with_pdftex" != no && : ${needs_libxpdf=yes}
|
|
-test "$with_pdfetex" != no && : ${needs_libxpdf=yes}
|
|
-test "$with_xetex" != no && : ${needs_libxpdf=yes}
|
|
+test "$with_pdftex" != no && : ${needs_libxpdf=no}
|
|
+test "$with_pdfetex" != no && : ${needs_libxpdf=no}
|
|
+test "$with_xetex" != no && : ${needs_libxpdf=no}
|
|
: ${needs_libxpdf=no}
|
|
export needs_libxpdf
|
|
|
|
@@ -207,7 +207,7 @@ dnl We cannot use variables (e.g. $LIBPN
|
|
sinclude(libs/libpng/libpng.ac)
|
|
sinclude(libs/zlib/zlib.ac)
|
|
sinclude(libs/ncurses/ncurses.ac)
|
|
-sinclude(libs/xpdf/libxpdf.ac)
|
|
+#sinclude(libs/xpdf/libxpdf.ac)
|
|
sinclude(libs/t1lib/t1lib.ac)
|
|
sinclude(libs/gd/gd.ac)
|
|
sinclude(libs/freetype/freetype.ac)
|
|
diff -up texlive-2007/configure.poppler texlive-2007/configure
|
|
--- texlive-2007/configure.poppler 2007-01-09 09:16:26.000000000 -0500
|
|
+++ texlive-2007/configure 2008-11-11 22:38:31.000000000 -0500
|
|
@@ -3442,9 +3442,9 @@ export needs_zlib
|
|
|
|
# we need libxpdf for pdf[ex]tex, xetex
|
|
test ! -d $srcdir/$LIBXPDFDIR && : ${needs_libxpdf=no}
|
|
-test "$with_pdftex" != no && : ${needs_libxpdf=yes}
|
|
-test "$with_pdfetex" != no && : ${needs_libxpdf=yes}
|
|
-test "$with_xetex" != no && : ${needs_libxpdf=yes}
|
|
+test "$with_pdftex" != no && : ${needs_libxpdf=no}
|
|
+test "$with_pdfetex" != no && : ${needs_libxpdf=no}
|
|
+test "$with_xetex" != no && : ${needs_libxpdf=no}
|
|
: ${needs_libxpdf=no}
|
|
export needs_libxpdf
|
|
|
|
diff -up texlive-2007/texk/web2c/pdftexdir/pdftexextra.in.poppler texlive-2007/texk/web2c/pdftexdir/pdftexextra.in
|
|
--- texlive-2007/texk/web2c/pdftexdir/pdftexextra.in.poppler 2006-12-26 18:37:34.000000000 -0500
|
|
+++ texlive-2007/texk/web2c/pdftexdir/pdftexextra.in 2008-11-11 22:38:31.000000000 -0500
|
|
@@ -26,7 +26,7 @@ $Id: pdftexextra.in,v 1.4 2004/08/26 18:
|
|
(generated from ../lib/texmfmp.c).
|
|
*/
|
|
|
|
-#define BANNER "This is pdfTeX, Version 3.141592-PDFTEX-VERSION-ETEX-VERSION"
|
|
+#define BANNER "This is pdfTeX using libpoppler, Version 3.141592-PDFTEX-VERSION-ETEX-VERSION"
|
|
#define COPYRIGHT_HOLDER "Peter Breitenlohner (eTeX)/Han The Thanh (pdfTeX)"
|
|
#define AUTHOR NULL
|
|
#define PROGRAM_HELP PDFTEXHELP
|
|
diff -up texlive-2007/texk/web2c/pdftexdir/pdftex.mk.poppler texlive-2007/texk/web2c/pdftexdir/pdftex.mk
|
|
--- texlive-2007/texk/web2c/pdftexdir/pdftex.mk.poppler 2006-12-26 18:37:34.000000000 -0500
|
|
+++ texlive-2007/texk/web2c/pdftexdir/pdftex.mk 2008-11-11 22:38:31.000000000 -0500
|
|
@@ -2,6 +2,9 @@
|
|
# This fragment contains the parts of the makefile that are most likely to
|
|
# differ between releases of pdfeTeX.
|
|
|
|
+# use libpoppler instead of included xpdf code
|
|
+ADDLDFLAGS = -lpoppler
|
|
+
|
|
# We build pdftex
|
|
pdftex = @PETEX@ pdftex
|
|
pdftexdir = pdftexdir
|
|
@@ -29,7 +32,7 @@ pdftex_o = pdftexini.o pdftex0.o pdftex1
|
|
|
|
# Making pdftex
|
|
pdftex: pdftexd.h $(pdftex_o) $(pdftexextra_o) $(pdftexlibsdep)
|
|
- @CXXHACKLINK@ $(pdftex_o) $(pdftexextra_o) $(pdftexlibs) $(socketlibs) @CXXHACKLDLIBS@ @CXXLDEXTRA@
|
|
+ @CXXHACKLINK@ $(pdftex_o) $(pdftexextra_o) $(pdftexlibs) $(socketlibs) @CXXHACKLDLIBS@ @CXXLDEXTRA@ $(ADDLDFLAGS)
|
|
|
|
# C file dependencies.
|
|
$(pdftex_c) pdftexcoerce.h pdftexd.h: pdftex.p $(web2c_texmf) $(srcdir)/$(pdftexdir)/pdftex.defines $(srcdir)/$(pdftexdir)/pdftex.h
|
|
@@ -156,7 +159,7 @@ ttf2afm-clean:
|
|
pdftosrc = pdftosrc
|
|
|
|
pdftosrc: $(pdftexdir)/pdftosrc.o $(LIBXPDFDEP)
|
|
- @CXXHACKLINK@ $(pdftexdir)/pdftosrc.o $(LDLIBXPDF) -lm @CXXLDEXTRA@
|
|
+ @CXXHACKLINK@ $(pdftexdir)/pdftosrc.o $(LDLIBXPDF) -lm @CXXLDEXTRA@ $(ADDLDFLAGS)
|
|
$(pdftexdir)/pdftosrc.o:$(srcdir)/$(pdftexdir)/pdftosrc.cc
|
|
cd $(pdftexdir) && $(MAKE) pdftosrc.o
|
|
check: pdftosrc-check
|
|
diff -up texlive-2007/texk/web2c/pdftexdir/pdftoepdf.cc.poppler texlive-2007/texk/web2c/pdftexdir/pdftoepdf.cc
|
|
--- texlive-2007/texk/web2c/pdftexdir/pdftoepdf.cc.poppler 2006-12-26 18:37:34.000000000 -0500
|
|
+++ texlive-2007/texk/web2c/pdftexdir/pdftoepdf.cc 2008-11-11 22:38:31.000000000 -0500
|
|
@@ -26,25 +26,24 @@ $Id: pdftoepdf.cc,v 1.9 2006/09/01 18:06
|
|
#include <stdio.h>
|
|
#include <string.h>
|
|
#include <ctype.h>
|
|
-#include <aconf.h>
|
|
-#include <GString.h>
|
|
-#include <gmem.h>
|
|
-#include <gfile.h>
|
|
-#include <config.h>
|
|
#include <assert.h>
|
|
-#include "Object.h"
|
|
-#include "Stream.h"
|
|
-#include "Array.h"
|
|
-#include "Dict.h"
|
|
-#include "XRef.h"
|
|
-#include "Catalog.h"
|
|
-#include "Link.h"
|
|
-#include "Page.h"
|
|
-#include "GfxFont.h"
|
|
-#include "PDFDoc.h"
|
|
-#include "GlobalParams.h"
|
|
-#include "Error.h"
|
|
-
|
|
+#include <dirent.h>
|
|
+#include <poppler/poppler-config.h>
|
|
+#include <poppler/goo/GooString.h>
|
|
+#include <poppler/goo/gmem.h>
|
|
+#include <poppler/goo/gfile.h>
|
|
+#include "poppler/Object.h"
|
|
+#include "poppler/Stream.h"
|
|
+#include "poppler/Array.h"
|
|
+#include "poppler/Dict.h"
|
|
+#include "poppler/XRef.h"
|
|
+#include "poppler/Link.h"
|
|
+#include "poppler/Catalog.h"
|
|
+#include "poppler/Page.h"
|
|
+#include "poppler/GfxFont.h"
|
|
+#include "poppler/PDFDoc.h"
|
|
+#include "poppler/GlobalParams.h"
|
|
+#include "poppler/Error.h"
|
|
#include "epdf.h"
|
|
|
|
// This file is mostly C and not very much C++; it's just used to interface
|
|
@@ -169,7 +168,7 @@ static PdfDocument *find_add_document(ch
|
|
fprintf(stderr, "\npdfTeX Debug: Creating %s (%d)\n", p->file_name,
|
|
p->occurences);
|
|
#endif
|
|
- GString *docName = new GString(p->file_name);
|
|
+ GooString *docName = new GooString(p->file_name);
|
|
p->doc = new PDFDoc(docName); // takes ownership of docName
|
|
if (!p->doc->isOk() || !p->doc->okToPrint()) {
|
|
pdftex_fail("xpdf: reading PDF image failed");
|
|
@@ -511,7 +510,7 @@ static void copyObject(Object * obj)
|
|
int i, l, c;
|
|
Ref ref;
|
|
char *p;
|
|
- GString *s;
|
|
+ GooString *s;
|
|
if (obj->isBool()) {
|
|
pdf_printf("%s", obj->getBool()? "true" : "false");
|
|
} else if (obj->isInt()) {
|
|
@@ -703,7 +702,7 @@ read_pdf_info(char *image_name, char *pa
|
|
epdf_num_pages = pdf_doc->doc->getCatalog()->getNumPages();
|
|
if (page_name) {
|
|
// get page by name
|
|
- GString name(page_name);
|
|
+ GooString name(page_name);
|
|
LinkDest *link = pdf_doc->doc->findDest(&name);
|
|
if (link == 0 || !link->isOk())
|
|
pdftex_fail("PDF inclusion: invalid destination <%s>", page_name);
|
|
diff -up texlive-2007/texk/web2c/pdftexdir/pdftosrc.cc.poppler texlive-2007/texk/web2c/pdftexdir/pdftosrc.cc
|
|
--- texlive-2007/texk/web2c/pdftexdir/pdftosrc.cc.poppler 2006-12-26 18:37:34.000000000 -0500
|
|
+++ texlive-2007/texk/web2c/pdftexdir/pdftosrc.cc 2008-11-11 22:38:31.000000000 -0500
|
|
@@ -25,22 +25,23 @@ $Id: //depot/Build/source.development/Te
|
|
#include <stdio.h>
|
|
#include <string.h>
|
|
#include <ctype.h>
|
|
-#include <aconf.h>
|
|
#include <assert.h>
|
|
-#include <GString.h>
|
|
-#include <gmem.h>
|
|
-#include <gfile.h>
|
|
-#include "Object.h"
|
|
-#include "Stream.h"
|
|
-#include "Array.h"
|
|
-#include "Dict.h"
|
|
-#include "XRef.h"
|
|
-#include "Catalog.h"
|
|
-#include "Page.h"
|
|
-#include "GfxFont.h"
|
|
-#include "PDFDoc.h"
|
|
-#include "GlobalParams.h"
|
|
-#include "Error.h"
|
|
+
|
|
+#include <dirent.h>
|
|
+#include <poppler/goo/GooString.h>
|
|
+#include <poppler/goo/gmem.h>
|
|
+#include <poppler/goo/gfile.h>
|
|
+#include <poppler/Object.h>
|
|
+#include <poppler/Stream.h>
|
|
+#include <poppler/Array.h>
|
|
+#include <poppler/Dict.h>
|
|
+#include <poppler/XRef.h>
|
|
+#include <poppler/Catalog.h>
|
|
+#include <poppler/Page.h>
|
|
+#include <poppler/GfxFont.h>
|
|
+#include <poppler/PDFDoc.h>
|
|
+#include <poppler/GlobalParams.h>
|
|
+#include <poppler/Error.h>
|
|
|
|
static XRef *xref = 0;
|
|
|
|
@@ -48,7 +49,7 @@ int main(int argc, char *argv[])
|
|
{
|
|
char *p, buf[1024];
|
|
PDFDoc *doc;
|
|
- GString *fileName;
|
|
+ GooString *fileName;
|
|
Stream *s;
|
|
Object srcStream, srcName, catalogDict;
|
|
FILE *outfile;
|
|
@@ -56,13 +57,13 @@ int main(int argc, char *argv[])
|
|
int objnum = 0, objgen = 0;
|
|
bool extract_xref_table = false;
|
|
int c;
|
|
- fprintf(stderr, "pdftosrc version %s\n", xpdfVersion);
|
|
+ fprintf(stderr, "pdftosrc\n");
|
|
if (argc < 2) {
|
|
fprintf(stderr,
|
|
"Usage: pdftosrc <PDF-file> [<stream-object-number>]\n");
|
|
exit(1);
|
|
}
|
|
- fileName = new GString(argv[1]);
|
|
+ fileName = new GooString(argv[1]);
|
|
globalParams = new GlobalParams();
|
|
doc = new PDFDoc(fileName);
|
|
if (!doc->isOk()) {
|
|
diff -up texlive-2007/texk/web2c/pdftexdir/utils.c.poppler texlive-2007/texk/web2c/pdftexdir/utils.c
|
|
--- texlive-2007/texk/web2c/pdftexdir/utils.c.poppler 2007-01-01 12:20:03.000000000 -0500
|
|
+++ texlive-2007/texk/web2c/pdftexdir/utils.c 2008-11-11 22:38:31.000000000 -0500
|
|
@@ -37,7 +37,7 @@ $Id: //depot/Build/source.development/Te
|
|
#include "zlib.h"
|
|
#include "ptexlib.h"
|
|
#include "png.h"
|
|
-#include "xpdf/config.h" /* just to get the xpdf version */
|
|
+#include "poppler/poppler-config.h" /* just to get the xpdf version */
|
|
|
|
#define check_nprintf(size_get, size_want) \
|
|
if ((unsigned)(size_get) >= (unsigned)(size_want)) \
|
|
@@ -1261,9 +1261,9 @@ void initversionstring(char **versions)
|
|
(void) asprintf(versions,
|
|
"Compiled with libpng %s; using libpng %s\n"
|
|
"Compiled with zlib %s; using zlib %s\n"
|
|
- "Compiled with xpdf version %s\n",
|
|
+ "Compiled with libpoppler\n",
|
|
PNG_LIBPNG_VER_STRING, png_libpng_ver,
|
|
- ZLIB_VERSION, zlib_version, xpdfVersion);
|
|
+ ZLIB_VERSION, zlib_version);
|
|
}
|
|
|
|
|
|
diff -up texlive-2007/texk/web2c/xetexdir/pdfimage.cpp.poppler texlive-2007/texk/web2c/xetexdir/pdfimage.cpp
|
|
--- texlive-2007/texk/web2c/xetexdir/pdfimage.cpp.poppler 2006-12-09 05:29:12.000000000 -0500
|
|
+++ texlive-2007/texk/web2c/xetexdir/pdfimage.cpp 2008-11-11 22:38:31.000000000 -0500
|
|
@@ -11,10 +11,24 @@
|
|
|
|
#include "pdfimage.h"
|
|
|
|
-#include "PDFDoc.h"
|
|
-#include "Catalog.h"
|
|
-#include "Page.h"
|
|
-#include "GString.h"
|
|
+#include <dirent.h>
|
|
+#include <poppler/poppler-config.h>
|
|
+#include <poppler/goo/GooString.h>
|
|
+#include <poppler/goo/gmem.h>
|
|
+#include <poppler/goo/gfile.h>
|
|
+#include "poppler/Object.h"
|
|
+#include "poppler/Stream.h"
|
|
+#include "poppler/Array.h"
|
|
+#include "poppler/Dict.h"
|
|
+#include "poppler/XRef.h"
|
|
+#include "poppler/Link.h"
|
|
+#include "poppler/Catalog.h"
|
|
+#include "poppler/Page.h"
|
|
+#include "poppler/GfxFont.h"
|
|
+#include "poppler/PDFDoc.h"
|
|
+#include "poppler/GlobalParams.h"
|
|
+#include "poppler/Error.h"
|
|
+
|
|
|
|
#include "XeTeX_ext.h"
|
|
|
|
@@ -28,7 +42,7 @@ my_fmin(double x, double y)
|
|
int
|
|
pdf_get_rect(char* filename, int page_num, int pdf_box, realrect* box)
|
|
{
|
|
- GString* name = new GString(filename);
|
|
+ GooString* name = new GooString(filename);
|
|
PDFDoc* doc = new PDFDoc(name);
|
|
|
|
if (!doc) {
|
|
diff -up texlive-2007/texk/web2c/xetexdir/XeTeX_ext.c.poppler texlive-2007/texk/web2c/xetexdir/XeTeX_ext.c
|
|
--- texlive-2007/texk/web2c/xetexdir/XeTeX_ext.c.poppler 2007-01-15 08:04:36.000000000 -0500
|
|
+++ texlive-2007/texk/web2c/xetexdir/XeTeX_ext.c 2008-11-11 22:39:46.000000000 -0500
|
|
@@ -33,7 +33,7 @@ authorization from SIL International.
|
|
*/
|
|
|
|
#ifdef XETEX_OTHER
|
|
-#include "xpdf/config.h"
|
|
+#include "poppler/poppler-config.h"
|
|
#include "png.h"
|
|
#endif
|
|
|
|
@@ -194,7 +194,7 @@ void initversionstring(char **versions)
|
|
#else
|
|
"Compiled with fontconfig version %d.%d.%d; using %d.%d.%d\n"
|
|
"Compiled with libpng version %s; using %s\n"
|
|
- "Compiled with xpdf version %s\n"
|
|
+ "Compiled with libpoppler\n"
|
|
#endif
|
|
;
|
|
|
|
@@ -205,7 +205,6 @@ void initversionstring(char **versions)
|
|
#ifdef XETEX_OTHER
|
|
+ strlen(PNG_LIBPNG_VER_STRING)
|
|
+ strlen(png_libpng_ver)
|
|
- + strlen(xpdfVersion)
|
|
+ 6 * 3 /* for fontconfig version #s (won't really need 3 digits per field!) */
|
|
#endif
|
|
+ 6 * 3; /* for freetype version #s (ditto) */
|
|
@@ -229,8 +228,7 @@ void initversionstring(char **versions)
|
|
,
|
|
FC_VERSION / 10000, (FC_VERSION % 10000) / 100, FC_VERSION % 100,
|
|
fc_version / 10000, (fc_version % 10000) / 100, fc_version % 100,
|
|
- PNG_LIBPNG_VER_STRING, png_libpng_ver,
|
|
- xpdfVersion
|
|
+ PNG_LIBPNG_VER_STRING, png_libpng_ver
|
|
#endif
|
|
);
|
|
}
|
|
diff -up texlive-2007/texk/web2c/xetexdir/xetex.mk.poppler texlive-2007/texk/web2c/xetexdir/xetex.mk
|
|
--- texlive-2007/texk/web2c/xetexdir/xetex.mk.poppler 2008-11-11 22:38:31.000000000 -0500
|
|
+++ texlive-2007/texk/web2c/xetexdir/xetex.mk 2008-11-11 22:38:31.000000000 -0500
|
|
@@ -4,6 +4,10 @@
|
|
|
|
Makefile: $(srcdir)/xetexdir/xetex.mk
|
|
|
|
+# use libpoppler instead of included xpdf code
|
|
+ADDLDFLAGS = -lpoppler
|
|
+
|
|
+
|
|
# We build xetex unless configure decides to skip it
|
|
xetex = @XETEX@ xetex
|
|
|
|
@@ -29,7 +33,7 @@ xetex = @XETEX@ xetex
|
|
|
|
@XETEX_GENERIC@ XETEX_DEFINES = -DXETEX_OTHER
|
|
|
|
-@XETEX_GENERIC@ EXTRALIBS = @LDLIBXPDF@ @LDLIBPNG@ @LDFONTCONFIG@
|
|
+@XETEX_GENERIC@ EXTRALIBS = @LDLIBXPDF@ @LDLIBPNG@ @LDFONTCONFIG@ $(ADDLDFLAGS)
|
|
|
|
@XETEX_GENERIC@ EXTRADEPS = @LIBXPDFDEP@ @LIBPNGDEP@
|
|
|
|
@@ -144,7 +148,7 @@ pngimage.o: $(srcdir)/xetexdir/pngimage.
|
|
$(compile) $(ALL_CFLAGS) $(LIBPNGCPPFLAGS) $(ZLIBCPPFLAGS) -c $< -o $@
|
|
|
|
pdfimage.o: $(srcdir)/xetexdir/pdfimage.cpp $(srcdir)/xetexdir/pdfimage.h
|
|
- $(CXX) $(ALL_CFLAGS) $(LIBXPDFCPPFLAGS) -c $< -o $@
|
|
+ $(CXX) $(ALL_CFLAGS) $(LIBXPDFCPPFLAGS) -I/usr/include/poppler -c $< -o $@
|
|
|
|
XeTeX_pic.o: $(srcdir)/xetexdir/XeTeX_pic.c $(srcdir)/xetexdir/XeTeX_ext.h $(XeTeXImageHdrs)
|
|
$(compile) $(TECKITFLAGS) $(ALL_CFLAGS) $(XETEX_DEFINES) -c $< -o $@
|
|
@@ -187,7 +191,7 @@ XeTeXOTMath.o: $(srcdir)/xetexdir/XeTeXO
|
|
|
|
# special rules for files that need the TECkit headers as well
|
|
XeTeX_ext.o: $(srcdir)/xetexdir/XeTeX_ext.c xetexd.h
|
|
- $(compile) $(ICUCFLAGS) $(FTFLAGS) $(TECKITFLAGS) $(LIBPNGCPPFLAGS) $(LIBXPDFCPPFLAGS) $(ZLIBCPPFLAGS) $(ALL_CFLAGS) $(XETEX_DEFINES) -c $< -o $@
|
|
+ $(compile) $(ICUCFLAGS) $(FTFLAGS) $(TECKITFLAGS) $(LIBPNGCPPFLAGS) $(LIBXPDFCPPFLAGS) $(ZLIBCPPFLAGS) $(ALL_CFLAGS) $(XETEX_DEFINES) -I/usr/include/poppler -c $< -o $@
|
|
XeTeX_mac.o: $(srcdir)/xetexdir/XeTeX_mac.c xetexd.h
|
|
$(compile) $(ICUCFLAGS) $(TECKITFLAGS) $(ALL_CFLAGS) $(XETEX_DEFINES) -c $< -o $@
|
|
|