summaryrefslogtreecommitdiff
path: root/Build/source/texk/web2c/luatexdir/image
diff options
context:
space:
mode:
authorPeter Breitenlohner <peb@mppmu.mpg.de>2009-11-10 10:27:09 +0000
committerPeter Breitenlohner <peb@mppmu.mpg.de>2009-11-10 10:27:09 +0000
commit5e8e9500102800e68c9e7fcac9e85c1668b71a36 (patch)
tree81d79ac70ffbb127e8063f18c8f55475ca169ee1 /Build/source/texk/web2c/luatexdir/image
parente6a9c88ada2f11dd61e4c4e39dff84944bed5787 (diff)
towards TL2010: texk/web2c
git-svn-id: svn://tug.org/texlive/trunk@15964 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/texk/web2c/luatexdir/image')
-rw-r--r--Build/source/texk/web2c/luatexdir/image/pdftoepdf.cc26
1 files changed, 25 insertions, 1 deletions
diff --git a/Build/source/texk/web2c/luatexdir/image/pdftoepdf.cc b/Build/source/texk/web2c/luatexdir/image/pdftoepdf.cc
index 0c54786c35f..536c6398cd7 100644
--- a/Build/source/texk/web2c/luatexdir/image/pdftoepdf.cc
+++ b/Build/source/texk/web2c/luatexdir/image/pdftoepdf.cc
@@ -666,7 +666,11 @@ static void writeEncodings()
}
for (r = encodingList; r != NULL; r = n) {
n = r->next;
+#ifdef POPPLER_VERSION
+ r->font->decRefCnt();
+#else
delete r->font;
+#endif
delete r;
}
}
@@ -705,7 +709,12 @@ read_pdf_info(image_dict * idict, integer minor_pdf_version_wanted,
Page *page;
int rotate;
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);
// initialize
@@ -720,6 +729,20 @@ read_pdf_info(image_dict * idict, integer 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) {
@@ -731,6 +754,7 @@ read_pdf_info(image_dict * idict, integer 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