summaryrefslogtreecommitdiff
blob: 973ec53772ee90b551f7ca6ee353db06022e1ff3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
Index: pdftex-1.40.9/src/texk/web2c/pdftexdir/pdftoepdf.cc
===================================================================
--- pdftex-1.40.9.orig/src/texk/web2c/pdftexdir/pdftoepdf.cc
+++ pdftex-1.40.9/src/texk/web2c/pdftexdir/pdftoepdf.cc
@@ -685,7 +685,7 @@ read_pdf_info(char *image_name, char *pa
     Page *page;
     int rotate;
     PDFRectangle *pagebox;
-    float pdf_version_found, pdf_version_wanted;
+    int minor_pdf_version_found, major_pdf_version_found;
     // initialize
     if (!isInit) {
         globalParams = new GlobalParams();
@@ -700,15 +700,15 @@ read_pdf_info(char *image_name, char *pa
     // 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.
-    pdf_version_found = pdf_doc->doc->getPDFVersion();
-    pdf_version_wanted = 1 + (minor_pdf_version_wanted * 0.1);
-    if (pdf_version_found > pdf_version_wanted) {
+    minor_pdf_version_found = pdf_doc->doc->getPDFMinorVersion();
+    major_pdf_version_found = pdf_doc->doc->getPDFMajorVersion();
+    if (major_pdf_version_found > 1 || minor_pdf_version_found > minor_pdf_version_wanted) {
         char msg[] =
-            "PDF inclusion: found PDF version <%.1f>, but at most version <%.1f> allowed";
+            "PDF inclusion: found PDF version <%d.%d>, but at most version <1.%d> allowed";
         if (pdf_inclusion_errorlevel > 0) {
-            pdftex_fail(msg, pdf_version_found, pdf_version_wanted);
+            pdftex_fail(msg, major_pdf_version_found, minor_pdf_version_found, minor_pdf_version_wanted);
         } else {
-            pdftex_warn(msg, pdf_version_found, pdf_version_wanted);
+            pdftex_warn(msg, major_pdf_version_found, minor_pdf_version_found, minor_pdf_version_wanted);
         }
     }
     epdf_num_pages = pdf_doc->doc->getCatalog()->getNumPages();