summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Breitenlohner <peb@mppmu.mpg.de>2010-04-13 12:05:41 +0000
committerPeter Breitenlohner <peb@mppmu.mpg.de>2010-04-13 12:05:41 +0000
commitf4844d60ab6540a3a081a5c21a826376a09152c3 (patch)
tree8eb5b5af433f81b441aa14381fff9c9c22884955
parentd6feeaecc599235e45a89abbb43c3591dfd28374 (diff)
luatex: fix --with-system-xpdf (poppler) build
git-svn-id: svn://tug.org/texlive/trunk@17839 c570f23f-e606-0410-a88d-b1316a301751
-rw-r--r--Build/source/texk/web2c/luatexdir/ChangeLog4
-rw-r--r--Build/source/texk/web2c/luatexdir/image/pdftoepdf.cc22
2 files changed, 25 insertions, 1 deletions
diff --git a/Build/source/texk/web2c/luatexdir/ChangeLog b/Build/source/texk/web2c/luatexdir/ChangeLog
index 1306f88a12c..f42fd211713 100644
--- a/Build/source/texk/web2c/luatexdir/ChangeLog
+++ b/Build/source/texk/web2c/luatexdir/ChangeLog
@@ -1,3 +1,7 @@
+2010-04-13 Peter Breitenlohner <peb@mppmu.mpg.de>
+
+ * image/pdftoepdf.cc: Fix building with libpoppler.
+
2010-04-13 Taco Hoekwater <taco@luatex>
* new import from luatex repository (HEAD of 0.60.x branch)
diff --git a/Build/source/texk/web2c/luatexdir/image/pdftoepdf.cc b/Build/source/texk/web2c/luatexdir/image/pdftoepdf.cc
index 2681684a278..655fdd8842e 100644
--- a/Build/source/texk/web2c/luatexdir/image/pdftoepdf.cc
+++ b/Build/source/texk/web2c/luatexdir/image/pdftoepdf.cc
@@ -471,7 +471,12 @@ read_pdf_info(image_dict * idict, int minor_pdf_version_wanted,
int rotate;
char *checksum;
PDFRectangle *pagebox;
- float pdf_version_found, pdf_version_wanted, xsize, ysize, xorig, yorig;
+#ifdef HAVE_GETPDFMAJORVERSION
+ int pdf_major_version_found, pdf_minor_version_found;
+#else
+ float pdf_version_found, pdf_version_wanted;
+#endif
+ float xsize, ysize, xorig, yorig;
assert(idict != NULL);
assert(img_type(idict) == IMG_TYPE_PDF);
assert(readtype == IMG_CLOSEINBETWEEN); // only this is implemented
@@ -494,6 +499,20 @@ read_pdf_info(image_dict * idict, int minor_pdf_version_wanted,
// this works only for PDF 1.x -- but since any versions of PDF newer
// than 1.x will not be backwards compatible to PDF 1.x, pdfTeX will
// then have to changed drastically anyway.
+#ifdef HAVE_GETPDFMAJORVERSION
+ pdf_major_version_found = pdf_doc->doc->getPDFMajorVersion();
+ pdf_minor_version_found = pdf_doc->doc->getPDFMinorVersion();
+ if ((pdf_major_version_found > 1)
+ || (pdf_minor_version_found > minor_pdf_version_wanted)) {
+ const char *msg =
+ "PDF inclusion: found PDF version <%d.%d>, but at most version <1.%d> allowed";
+ if (pdf_inclusion_errorlevel > 0) {
+ pdftex_fail(msg, pdf_major_version_found, pdf_minor_version_found, minor_pdf_version_wanted);
+ } else {
+ pdftex_warn(msg, pdf_major_version_found, pdf_minor_version_found, minor_pdf_version_wanted);
+ }
+ }
+#else
pdf_version_found = pdf_doc->doc->getPDFVersion();
pdf_version_wanted = 1 + (minor_pdf_version_wanted * 0.1);
if (pdf_version_found > pdf_version_wanted + 0.01) {
@@ -505,6 +524,7 @@ read_pdf_info(image_dict * idict, int minor_pdf_version_wanted,
pdftex_warn(msg, pdf_version_found, pdf_version_wanted);
}
}
+#endif
img_totalpages(idict) = pdf_doc->doc->getCatalog()->getNumPages();
if (img_pagename(idict)) {
// get page by name