\pdfmajorversion

Joseph Wright joseph.wright at morningstar2.co.uk
Mon Oct 21 12:54:47 CEST 2019


On 20/10/2019 22:03, Joseph Wright wrote:
> On 20/10/2019 21:34, Joseph Wright wrote:
>> Hello all,
>>
>> I've started looking at PDF-2.0 support for pdfTeX. The attached 
>> introduces \pdfmajorversion for the binary: I need to look at the 
>> manual too.
>>
>> At present, this does *not* address PDF inclusion: that requires 
>> minimal changes in the WEB but more significant changes in the C, and 
>> that looks more 'interesting'. I'm sending this first so others can 
>> test, etc.
>>
>> Feedback welcome.
>>
>> Joseph
> 
> I'm working slowly on other stuff:
> 
> https://github.com/josephwright/texlive-source/tree/PDF-2.0
> 
> Joseph

Updated version of the patch is attached. This should cover all of the 
key points:

- PDF major version is allowed from 1 upward
- Minor fixes compared with previous patch
- Image inclusion checks \pdfmajorversion

Some of the error messages were a bit long if I said both 
\pdfmajorversion and \pdfminorversion, hence the re-phrasing.

Testing to date has been (a) does it build (Ubuntu as WSL, Travis-CI) 
and (b) does a very simple LaTeX document work. I'm pretty confident 
that setting "%PDF-2.0" is fine, but the image inclusion part may be 
more tricky. (In particular, I'm not sure whether the build set up uses 
the Poppler branch for PDF data retrieval.)

Joseph
-------------- next part --------------
From 71ccf3a65c849315a96a7c9c1c24084c4f80d1e9 Mon Sep 17 00:00:00 2001
From: Joseph Wright <joseph.wright at morningstar2.co.uk>
Date: Sun, 20 Oct 2019 20:17:45 +0100
Subject: [PATCH] Introduce \pdfmajorversion

The bulk of the work is focussed on the TeX support, but there is also a need to pass
the major version to image inclusion.

Note that there are no changes to the PDF other than the 'ID' line.
---
 texk/web2c/pdftexdir/pdftex-common.h |   2 +-
 texk/web2c/pdftexdir/pdftex.web      | 100 ++++++++++++++++-----------
 texk/web2c/pdftexdir/pdftoepdf.cc    |  12 ++--
 texk/web2c/pdftexdir/ptexlib.h       |   4 +-
 texk/web2c/pdftexdir/writeimg.c      |  16 ++---
 5 files changed, 76 insertions(+), 58 deletions(-)

diff --git a/texk/web2c/pdftexdir/pdftex-common.h b/texk/web2c/pdftexdir/pdftex-common.h
index 307ba64a3..494e9f2d0 100644
--- a/texk/web2c/pdftexdir/pdftex-common.h
+++ b/texk/web2c/pdftexdir/pdftex-common.h
@@ -83,7 +83,7 @@ extern fm_entry *lookup_fontmap(char *);
 /* pdftoepdf.cc */
 extern void epdf_check_mem(void);
 extern void epdf_delete(void);
-extern int read_pdf_info(char *, char *, int, int, int, int);
+extern int read_pdf_info(char *, char *, int, int, int, int, int);
 
 /* utils.c */
 extern char *convertStringToPDFString(const char *in, int len);
diff --git a/texk/web2c/pdftexdir/pdftex.web b/texk/web2c/pdftexdir/pdftex.web
index 80b6e00f8..39bf2d90f 100644
--- a/texk/web2c/pdftexdir/pdftex.web
+++ b/texk/web2c/pdftexdir/pdftex.web
@@ -5669,31 +5669,32 @@ that will be defined later.
 @d pdf_unique_resname_code   = pdftex_first_integer_code + 6 {generate unique names for resouces}
 @d pdf_option_always_use_pdfpagebox_code = pdftex_first_integer_code + 7 {if the PDF inclusion should always use a specific PDF page box}
 @d pdf_option_pdf_inclusion_errorlevel_code = pdftex_first_integer_code + 8 {if the PDF inclusion should treat pdfs newer than |pdf_minor_version| as an error}
- at d pdf_minor_version_code = pdftex_first_integer_code + 9 {fractional part of the PDF version produced}
- at d pdf_force_pagebox_code = pdftex_first_integer_code + 10 {if the PDF inclusion should always use a specific PDF page box}
- at d pdf_pagebox_code = pdftex_first_integer_code + 11 {default pagebox to use for PDF inclusion}
- at d pdf_inclusion_errorlevel_code = pdftex_first_integer_code + 12 {if the PDF inclusion should treat pdfs newer than |pdf_minor_version| as an error}
- at d pdf_gamma_code            = pdftex_first_integer_code + 13
- at d pdf_image_gamma_code      = pdftex_first_integer_code + 14
- at d pdf_image_hicolor_code    = pdftex_first_integer_code + 15
- at d pdf_image_apply_gamma_code = pdftex_first_integer_code + 16
- at d pdf_adjust_spacing_code   = pdftex_first_integer_code + 17 {level of spacing adjusting}
- at d pdf_protrude_chars_code   = pdftex_first_integer_code + 18 {protrude chars at left/right edge of paragraphs}
- at d pdf_tracing_fonts_code    = pdftex_first_integer_code + 19 {level of font detail in log}
- at d pdf_objcompresslevel_code = pdftex_first_integer_code + 20 {activate object streams}
- at d pdf_adjust_interword_glue_code    = pdftex_first_integer_code + 21 {adjust interword glue?}
- at d pdf_prepend_kern_code     = pdftex_first_integer_code + 22 {prepend kern before certain characters?}
- at d pdf_append_kern_code      = pdftex_first_integer_code + 23 {append kern before certain characters?}
- at d pdf_gen_tounicode_code    = pdftex_first_integer_code + 24 {generate ToUnicode for fonts?}
- at d pdf_draftmode_code        = pdftex_first_integer_code + 25 {switch on draftmode if positive}
- at d pdf_inclusion_copy_font_code = pdftex_first_integer_code + 26 {generate ToUnicode for fonts?}
- at d pdf_suppress_warning_dup_dest_code    = pdftex_first_integer_code + 27 {suppress warning about duplicated destinations}
- at d pdf_suppress_warning_dup_map_code     = pdftex_first_integer_code + 28 {suppress warning about duplicated map lines}
- at d pdf_suppress_warning_page_group_code  = pdftex_first_integer_code + 29 {suppress warning about multiple pdfs with page group}
- at d pdf_info_omit_date_code  = pdftex_first_integer_code + 30 {omit generating CreationDate and ModDate}
- at d pdf_suppress_ptex_info_code = pdftex_first_integer_code + 31 {suppress /PTEX.* entries in PDF dictionaries}
- at d pdf_omit_charset_code = pdftex_first_integer_code + 32 {suppress /PTEX.* entries in PDF dictionaries}
- at d pdf_int_pars=pdftex_first_integer_code + 33 {total number of \pdfTeX's integer parameters}
+ at d pdf_major_version_code = pdftex_first_integer_code + 9 {integer part of the PDF version produced}
+ at d pdf_minor_version_code = pdftex_first_integer_code + 10 {fractional part of the PDF version produced}
+ at d pdf_force_pagebox_code = pdftex_first_integer_code + 11 {if the PDF inclusion should always use a specific PDF page box}
+ at d pdf_pagebox_code = pdftex_first_integer_code + 12 {default pagebox to use for PDF inclusion}
+ at d pdf_inclusion_errorlevel_code = pdftex_first_integer_code + 13 {if the PDF inclusion should treat pdfs newer than |pdf_minor_version| as an error}
+ at d pdf_gamma_code            = pdftex_first_integer_code + 14
+ at d pdf_image_gamma_code      = pdftex_first_integer_code + 15
+ at d pdf_image_hicolor_code    = pdftex_first_integer_code + 16
+ at d pdf_image_apply_gamma_code = pdftex_first_integer_code + 17
+ at d pdf_adjust_spacing_code   = pdftex_first_integer_code + 18 {level of spacing adjusting}
+ at d pdf_protrude_chars_code   = pdftex_first_integer_code + 19 {protrude chars at left/right edge of paragraphs}
+ at d pdf_tracing_fonts_code    = pdftex_first_integer_code + 20 {level of font detail in log}
+ at d pdf_objcompresslevel_code = pdftex_first_integer_code + 21 {activate object streams}
+ at d pdf_adjust_interword_glue_code    = pdftex_first_integer_code + 22 {adjust interword glue?}
+ at d pdf_prepend_kern_code     = pdftex_first_integer_code + 23 {prepend kern before certain characters?}
+ at d pdf_append_kern_code      = pdftex_first_integer_code + 24 {append kern before certain characters?}
+ at d pdf_gen_tounicode_code    = pdftex_first_integer_code + 25 {generate ToUnicode for fonts?}
+ at d pdf_draftmode_code        = pdftex_first_integer_code + 26 {switch on draftmode if positive}
+ at d pdf_inclusion_copy_font_code = pdftex_first_integer_code + 27 {generate ToUnicode for fonts?}
+ at d pdf_suppress_warning_dup_dest_code    = pdftex_first_integer_code + 28 {suppress warning about duplicated destinations}
+ at d pdf_suppress_warning_dup_map_code     = pdftex_first_integer_code + 29 {suppress warning about duplicated map lines}
+ at d pdf_suppress_warning_page_group_code  = pdftex_first_integer_code + 30 {suppress warning about multiple pdfs with page group}
+ at d pdf_info_omit_date_code  = pdftex_first_integer_code + 31 {omit generating CreationDate and ModDate}
+ at d pdf_suppress_ptex_info_code = pdftex_first_integer_code + 32 {suppress /PTEX.* entries in PDF dictionaries}
+ at d pdf_omit_charset_code = pdftex_first_integer_code + 33 {suppress /PTEX.* entries in PDF dictionaries}
+ at d pdf_int_pars=pdftex_first_integer_code + 34 {total number of \pdfTeX's integer parameters}
 @#
 @d etex_int_base=pdf_int_pars {base for \eTeX's integer parameters}
 @d tracing_assigns_code=etex_int_base {show assignments}
@@ -5789,6 +5790,7 @@ that will be defined later.
 @d pdf_unique_resname   == int_par(pdf_unique_resname_code)
 @d pdf_option_always_use_pdfpagebox == int_par(pdf_option_always_use_pdfpagebox_code)
 @d pdf_option_pdf_inclusion_errorlevel == int_par(pdf_option_pdf_inclusion_errorlevel_code)
+ at d pdf_major_version == int_par(pdf_major_version_code)
 @d pdf_minor_version == int_par(pdf_minor_version_code)
 @d pdf_force_pagebox == int_par(pdf_force_pagebox_code)
 @d pdf_pagebox == int_par(pdf_pagebox_code)
@@ -5890,6 +5892,7 @@ pdf_pk_resolution_code:    print_esc("pdfpkresolution");
 pdf_unique_resname_code:   print_esc("pdfuniqueresname");
 pdf_option_always_use_pdfpagebox_code: print_esc("pdfoptionalwaysusepdfpagebox");
 pdf_option_pdf_inclusion_errorlevel_code: print_esc("pdfoptionpdfinclusionerrorlevel");
+pdf_major_version_code: print_esc("pdfmajorversion");
 pdf_minor_version_code: print_esc("pdfminorversion");
 pdf_force_pagebox_code: print_esc("pdfforcepagebox");
 pdf_pagebox_code: print_esc("pdfpagebox");
@@ -6056,6 +6059,8 @@ primitive("pdfoptionalwaysusepdfpagebox",assign_int,int_base+pdf_option_always_u
 @!@:pdf_option_always_use_pdfpagebox_}{\.{\\pdfoptionalwaysusepdfpagebox} primitive@>
 primitive("pdfoptionpdfinclusionerrorlevel",assign_int,int_base+pdf_option_pdf_inclusion_errorlevel_code);@/
 @!@:pdf_option_pdf_inclusion_errorlevel_}{\.{\\pdfoptionpdfinclusionerrorlevel} primitive@>
+primitive("pdfmajorversion",assign_int,int_base+pdf_major_version_code);@/
+@!@:pdf_major_version_}{\.{\\pdfmajorversion} primitive@>
 primitive("pdfminorversion",assign_int,int_base+pdf_minor_version_code);@/
 @!@:pdf_minor_version_}{\.{\\pdfminorversion} primitive@>
 primitive("pdfforcepagebox",assign_int,int_base+pdf_force_pagebox_code);@/
@@ -15076,6 +15081,7 @@ pdf_compress_level := 9;
 pdf_objcompresslevel := 0;
 pdf_decimal_digits := 3;
 pdf_image_resolution := 72;
+pdf_major_version := 1;
 pdf_minor_version := 4;
 pdf_gamma := 1000;
 pdf_image_gamma := 2200;
@@ -15348,9 +15354,10 @@ end
 @!pdf_gone: longinteger; {number of bytes that were flushed to output}
 @!pdf_save_offset: longinteger; {to save |pdf_offset|}
 @!zip_write_state: integer; {which state of compression we are in}
+@!fixed_pdf_major_version: integer; {fixed major part of the PDF version}
 @!fixed_pdf_minor_version: integer; {fixed minor part of the PDF version}
 @!fixed_pdf_objcompresslevel: integer; {fixed level for activating PDF object streams}
-@!pdf_minor_version_written: boolean; {flag if the PDF version has been written}
+@!pdf_version_written: boolean; {flag if the PDF version has been written}
 @!fixed_pdfoutput: integer; {fixed output format}
 @!fixed_pdfoutput_set: boolean; {|fixed_pdfoutput| has been set?}
 @!fixed_gamma: integer;
@@ -15376,7 +15383,7 @@ pdf_os_buf_size := inf_pdf_os_buf_size;
 pdf_buf := pdf_op_buf;
 pdf_seek_write_length := false;
 zip_write_state := no_zip;
-pdf_minor_version_written := false;
+pdf_version_written := false;
 fixed_pdfoutput_set := false;
 fixed_pdf_draftmode_set := false;
 
@@ -15396,10 +15403,18 @@ end;
 been written to the generated PDF file. Here also the PDF file is opened
 by |ensure_pdf_open| and the PDF header is written.
 
- at p procedure check_pdfminorversion;
+ at p procedure check_pdfversion;
 begin
-    if not pdf_minor_version_written then begin
-        pdf_minor_version_written := true;
+    if not pdf_version_written then begin
+        pdf_version_written := true;
+        if pdf_major_version < 1 then begin
+            print_err("pdfTeX error (illegal pdfmajorversion)");
+            print_ln;
+            help2 ("The pdfmajorversion must be 1 or greater.")@/
+                ("I changed this to 1.");
+            int_error (pdf_major_version);
+            pdf_major_version := 1;
+        end;
         if (pdf_minor_version < 0) or (pdf_minor_version > 9) then begin
             print_err("pdfTeX error (illegal pdfminorversion)");
             print_ln;
@@ -15408,6 +15423,7 @@ begin
             int_error (pdf_minor_version);
             pdf_minor_version := 4;
         end;
+        fixed_pdf_major_version := pdf_major_version;
         fixed_pdf_minor_version := pdf_minor_version;
         fixed_gamma             := fix_int(pdf_gamma, 0, 1000000);
         fixed_image_gamma       := fix_int(pdf_image_gamma, 0, 1000000);
@@ -15416,18 +15432,20 @@ begin
         fixed_pdf_objcompresslevel := fix_int(pdf_objcompresslevel, 0, 3);
         fixed_pdf_draftmode     := fix_int(pdf_draftmode, 0, 1);
         fixed_inclusion_copy_font      := fix_int(pdf_inclusion_copy_font, 0, 1);
-        if (fixed_pdf_minor_version >= 5) and (fixed_pdf_objcompresslevel > 0) then
+        if ((fixed_pdf_major_version > 1) or (fixed_pdf_minor_version >= 5)) and (fixed_pdf_objcompresslevel > 0) then
             pdf_os_enable := true
         else begin
             if fixed_pdf_objcompresslevel > 0 then begin
-                pdf_warning("Object streams", "\pdfobjcompresslevel > 0 requires \pdfminorversion > 4. Object streams disabled now.", true, true);
+                pdf_warning("Object streams", "\pdfobjcompresslevel > 0 requires PDF-1.5 or greater. Object streams disabled now.", true, true);
                 fixed_pdf_objcompresslevel := 0;
             end;
             pdf_os_enable := false;
         end;
         ensure_pdf_open;
         fix_pdfoutput;
-        pdf_print("%PDF-1.");
+        pdf_print("%PDF-");
+        pdf_print_int(fixed_pdf_major_version);
+        pdf_print(".");
         pdf_print_int_ln(fixed_pdf_minor_version);
         pdf_print("%");
         pdf_out(208); {'P' + 128}
@@ -15437,9 +15455,9 @@ begin
         pdf_print_nl;
     end
     else begin
-        if fixed_pdf_minor_version <> pdf_minor_version then
+        if (fixed_pdf_minor_version <> pdf_minor_version) or (fixed_pdf_major_version <> pdf_major_version) then
             pdf_error("setup",
-               "\pdfminorversion cannot be changed after data is written to the PDF file");
+               "PDF version cannot be changed after data is written to the PDF file");
     end;
 end;
 
@@ -16769,7 +16787,7 @@ end;
 
 procedure pdf_begin_obj(i: integer; pdf_os_level: integer); {begin a PDF object}
 begin
-    check_pdfminorversion;
+    check_pdfversion;
     pdf_os_prepare_obj(i, pdf_os_level);
     if not pdf_os_mode then begin
         pdf_print_int(i);
@@ -16798,7 +16816,7 @@ end;
 
 procedure pdf_begin_dict(i: integer; pdf_os_level: integer); {begin a PDF dictionary object}
 begin
-    check_pdfminorversion;
+    check_pdfversion;
     pdf_os_prepare_obj(i, pdf_os_level);
     if not pdf_os_mode then begin
         pdf_print_int(i);
@@ -19647,7 +19665,7 @@ begin
 end;
 
 @ @<Initialize variables for \.{PDF} output@>=
-check_pdfminorversion;
+check_pdfversion;
 prepare_mag;
 fixed_decimal_digits := fix_int(pdf_decimal_digits, 0, 4);
 min_bp_val :=
@@ -32999,7 +33017,7 @@ already in an earlier module.
 
 @<Undump pdftex data@>=
 begin
-undumpimagemeta(pdf_minor_version,pdf_inclusion_errorlevel);  {the image information array }
+undumpimagemeta(pdf_major_version,pdf_minor_version,pdf_inclusion_errorlevel);  {the image information array }
 undump_int(pdf_mem_size);
 pdf_mem := xrealloc_array(pdf_mem, integer, pdf_mem_size);
 undump_int(pdf_mem_ptr);
@@ -34358,7 +34376,7 @@ begin
     if pagebox = 0 then {no pagebox specification given}
         pagebox := pdf_box_spec_crop;
     obj_ximage_data(k) := read_image(s, page, named, colorspace, pagebox,
-                                     pdf_minor_version,
+                                     pdf_major_version, pdf_minor_version,
                                      pdf_inclusion_errorlevel);
     if named <> 0 then flush_str(named);
     flush_str(s);
@@ -34371,7 +34389,7 @@ end;
 @ @<Implement \.{\\pdfximage}@>=
 begin
     check_pdfoutput("\pdfximage", true);
-    check_pdfminorversion;
+    check_pdfversion;
     scan_image;
 end
 
diff --git a/texk/web2c/pdftexdir/pdftoepdf.cc b/texk/web2c/pdftexdir/pdftoepdf.cc
index 4db0c90a6..4242ce3e3 100644
--- a/texk/web2c/pdftexdir/pdftoepdf.cc
+++ b/texk/web2c/pdftexdir/pdftoepdf.cc
@@ -719,7 +719,7 @@ static PDFRectangle *get_pagebox(Page * page, int pagebox_spec)
 
 int
 read_pdf_info(char *image_name, char *page_name, int page_num,
-              int pagebox_spec, int minor_pdf_version_wanted,
+              int pagebox_spec, int major_pdf_version_wanted, int minor_pdf_version_wanted,
               int pdf_inclusion_errorlevel)
 {
     PdfDocument *pdf_doc;
@@ -747,21 +747,21 @@ read_pdf_info(char *image_name, char *page_name, int page_num,
 #ifdef POPPLER_VERSION
     pdf_major_version_found = pdf_doc->doc->getPDFMajorVersion();
     pdf_minor_version_found = pdf_doc->doc->getPDFMinorVersion();
-    if ((pdf_major_version_found > 1)
+    if ((pdf_major_version_found > major_pdf_version_wanted)
      || (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";
+            "PDF inclusion: found PDF version <%d.%d>, but at most version <%d.%d> allowed";
         if (pdf_inclusion_errorlevel > 0) {
-            pdftex_fail(msg, pdf_major_version_found, pdf_minor_version_found, minor_pdf_version_wanted);
+            pdftex_fail(msg, pdf_major_version_found, pdf_minor_version_found, major_pdf_version_wanted, minor_pdf_version_wanted);
         } else if (pdf_inclusion_errorlevel < 0) {
             ; /* do nothing */
         } else { /* = 0, give warning */
-            pdftex_warn(msg, pdf_major_version_found, pdf_minor_version_found, minor_pdf_version_wanted);
+            pdftex_warn(msg, pdf_major_version_found, pdf_minor_version_found, major_pdf_version_wanted, minor_pdf_version_wanted);
         }
     }
 #else
     pdf_version_found = pdf_doc->doc->getPDFVersion();
-    pdf_version_wanted = 1 + (minor_pdf_version_wanted * 0.1);
+    pdf_version_wanted = major_pdf_version_wanted + (minor_pdf_version_wanted * 0.1);
     if (pdf_version_found > pdf_version_wanted + 0.01) {
         char msg[] =
             "PDF inclusion: found PDF version <%.1f>, but at most version <%.1f> allowed";
diff --git a/texk/web2c/pdftexdir/ptexlib.h b/texk/web2c/pdftexdir/ptexlib.h
index 03feb672c..e11ab0631 100644
--- a/texk/web2c/pdftexdir/ptexlib.h
+++ b/texk/web2c/pdftexdir/ptexlib.h
@@ -301,13 +301,13 @@ extern integer imagecolordepth(integer);
 extern integer getimagegroupref(integer);
 extern void setimagegroupref(integer,integer);
 extern integer readimage(strnumber, integer, strnumber, integer, integer,
-                         integer, integer);
+                         integer, integer, integer);
 extern void deleteimage(integer);
 extern void img_free(void);
 extern void updateimageprocset(integer);
 extern void writeimage(integer);
 extern void dumpimagemeta(void);
-extern void undumpimagemeta(integer, integer);
+extern void undumpimagemeta(integer, integer, integer);
 
 /* writejbig2.c */
 extern void flushjbig2page0objects(void);
diff --git a/texk/web2c/pdftexdir/writeimg.c b/texk/web2c/pdftexdir/writeimg.c
index 8455b03a5..c392df97c 100644
--- a/texk/web2c/pdftexdir/writeimg.c
+++ b/texk/web2c/pdftexdir/writeimg.c
@@ -292,7 +292,7 @@ static void checktypebyextension(integer img)
 
 integer readimage(strnumber s, integer page_num, strnumber page_name,
                   integer colorspace, integer pagebox,
-                  integer pdfversion, integer pdfinclusionerrorlevel)
+                  integer pdfmajorversion, integer pdfminorversion, integer pdfinclusionerrorlevel)
 {
     char *dest = NULL;
     integer img = new_image_entry();
@@ -316,7 +316,7 @@ integer readimage(strnumber s, integer page_num, strnumber page_name,
         pdf_ptr(img) = xtalloc(1, pdf_image_struct);
         pdf_ptr(img)->page_box = pagebox;
         page_num = read_pdf_info(img_name(img), dest, page_num, pagebox,
-                                 pdfversion, pdfinclusionerrorlevel);
+                                 pdfmajorversion, pdfminorversion, pdfinclusionerrorlevel);
         img_width(img) = bp2int(epdf_width);
         img_height(img) = bp2int(epdf_height);
         img_rotate(img) = epdf_rotate;
@@ -341,10 +341,10 @@ integer readimage(strnumber s, integer page_num, strnumber page_name,
         read_jpg_info(img);
         break;
     case IMAGE_TYPE_JBIG2:
-        if (pdfversion < 4) {
+        if (pdfmajorversion == 1 && pdfminorversion < 4) {
             pdftex_fail
                 ("JBIG2 images only possible with at least PDF 1.4; you are generating PDF 1.%i",
-                 (int) pdfversion);
+                 (int) pdfminorversion);
         }
         jbig2_ptr(img) = xtalloc(1, JBIG2_IMAGE_INFO);
         img_type(img) = IMAGE_TYPE_JBIG2;
@@ -507,7 +507,7 @@ void dumpimagemeta(void)
     }
 }
 
-void undumpimagemeta(integer pdfversion, integer pdfinclusionerrorlevel)
+void undumpimagemeta(integer pdfmajorversion, integer pdfminorversion, integer pdfinclusionerrorlevel)
 {
     int cur_image, img;
 
@@ -542,7 +542,7 @@ void undumpimagemeta(integer pdfversion, integer pdfinclusionerrorlevel)
             undumpinteger(pdf_ptr(img)->selected_page);
 
             read_pdf_info(img_name(img), NULL, pdf_ptr(img)->selected_page,
-                          pdf_ptr(img)->page_box, pdfversion,
+                          pdf_ptr(img)->page_box, pdfmajorversion, pdfminorversion,
                           pdfinclusionerrorlevel);
 
             img_width(img) = bp2int(epdf_width);
@@ -562,10 +562,10 @@ void undumpimagemeta(integer pdfversion, integer pdfinclusionerrorlevel)
             read_jpg_info(img);
             break;
         case IMAGE_TYPE_JBIG2:
-            if (pdfversion < 4) {
+            if (pdfmajorversion == 1 && pdfminorversion < 4) {
                 pdftex_fail
                     ("JBIG2 images only possible with at least PDF 1.4; you are generating PDF 1.%i",
-                     (int) pdfversion);
+                     (int) pdfminorversion);
             }
             jbig2_ptr(img) = xtalloc(1, JBIG2_IMAGE_INFO);
             img_type(img) = IMAGE_TYPE_JBIG2;
-- 
2.17.1



More information about the tex-live mailing list