diff options
Diffstat (limited to 'Build/source/texk/web2c/luatexdir/image/pdftoepdf.cc')
-rw-r--r-- | Build/source/texk/web2c/luatexdir/image/pdftoepdf.cc | 26 |
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 |