diff --git a/manual/luatex-backend.tex b/manual/luatex-backend.tex index 4c6c36bd7baa4962c4c6529beefacfdd2c318276..8d4c366c35ffa25aea0d812f8f0f02a2cf16b389 100644 --- a/manual/luatex-backend.tex +++ b/manual/luatex-backend.tex @@ -125,7 +125,7 @@ after the \PDFTEX\ equivalents. \stopsubsection \startsubsection[title={\type {[set|get]suppressoptionalinfo}, \type {[set|get]trailerid}, -\type {[set|get]omitcidset} and \type {[set|get]omitinfodict}}] +\type {[set|get]omitcidset}, \type {[set|get]omitinfodict} and \type {[set|get]omitmediabox}}] \topicindex{\PDF+options} \topicindex{\PDF+trailer} @@ -135,6 +135,7 @@ after the \PDFTEX\ equivalents. \libindex{getomitcidset} \libindex{setomitcidset} \libindex{getomitcharset} \libindex{setomitcharset} \libindex{getomitinfodict} \libindex{setomitinfodict} +\libindex{getomitmediabox} \libindex{setomitmediabox} The optional info bitset (a number) determines what kind of info gets flushed. By default we flush all. See \in {section} [sec:pdfextensions] for more details. @@ -146,6 +147,9 @@ The cidset, charset and info flags (numbers) disables inclusion of a so called \type {CIDSet} and \type {CharSet} entries, which can be handy when aiming at some of the many \PDF\ substandards. +When it is omitted, one should provide the \type {MediaBox} via the page attribute +options, because it is a mandate field. No checking is done. + \stopsubsection \startsubsection[title={\type {[set|get][obj|]compresslevel} and \type {[set|get]recompress}}] diff --git a/manual/luatex-modifications.tex b/manual/luatex-modifications.tex index e3edc59f79e5b6583d67138812cadd0a996b2369..d6dffe27400ecbf63997b9d9a5bfbf60d1d32781 100644 --- a/manual/luatex-modifications.tex +++ b/manual/luatex-modifications.tex @@ -667,6 +667,7 @@ The configuration related registers have become: \edef\pdfomitcidset {\pdfvariable omitcidset} \edef\pdfomitcharset {\pdfvariable omitcharset} \edef\pdfomitinfodict {\pdfvariable omitinfodict} +\edef\pdfomitmediabox {\pdfvariable omitmediabox} \edef\pdfpagebox {\pdfvariable pagebox} \edef\pdfminorversion {\pdfvariable minorversion} \edef\pdfuniqueresname {\pdfvariable uniqueresname} @@ -917,6 +918,7 @@ The engine sets the following defaults. \pdfomitcidset 0 \pdfomitcharset 0 \pdfomitinfodict 0 +\pdfomitmediabox 0 \pdfpagebox 0 \pdfminorversion 4 \pdfuniqueresname 0 diff --git a/manual/luatex.pdf b/manual/luatex.pdf index 12e7b2d00c0e71064c325f6fc758f9884af68338..ef9ec66fe8b559cab66803659b4917fe84e58274 100644 Binary files a/manual/luatex.pdf and b/manual/luatex.pdf differ diff --git a/manual/luatex.tex b/manual/luatex.tex index 9f7236b284a060771e012259a84d41f57a696a3f..1a3d684cea956d74242939e6a069118246378331 100644 --- a/manual/luatex.tex +++ b/manual/luatex.tex @@ -73,7 +73,7 @@ \startdocument [manual=Lua\TeX, status=stable, - version=1.15] + version=1.16] \startnotmode[*export] \component luatex-titlepage diff --git a/source/texk/web2c/luatexdir/ChangeLog b/source/texk/web2c/luatexdir/ChangeLog index bca2c97a43275b710e07750a8c3ac2829c38fdf6..91c534452059441e02115893b57d1afbd59df7d7 100644 --- a/source/texk/web2c/luatexdir/ChangeLog +++ b/source/texk/web2c/luatexdir/ChangeLog @@ -1,5 +1,9 @@ +2023-01-17 Luigi Scarso <luigi.scarso@gmail.com> + * \pdfvariable omitmediabox 1 (H.Hagen) + * luatex 1.16.0 + 2022-12-05 Luigi Scarso <luigi.scarso@gmail.com> - * complementaty patch for revision 7551 (lua end compatibility) (H.Hagen) + * complementary patch for revision 7551 (lua end compatibility) (H.Hagen) 2022-12-03 Luigi Scarso <luigi.scarso@gmail.com> * Track last node in ligature handling (M.Krüger) diff --git a/source/texk/web2c/luatexdir/lua/lpdflib.c b/source/texk/web2c/luatexdir/lua/lpdflib.c index 057af5ea6f39a677fd39f4441d11055b904f13d1..70fbde76bb9c879a2f01cf6df74bb59d36f12e47 100644 --- a/source/texk/web2c/luatexdir/lua/lpdflib.c +++ b/source/texk/web2c/luatexdir/lua/lpdflib.c @@ -820,6 +820,12 @@ static int getpdfomitinfodict(lua_State * L) return 1 ; } +static int getpdfomitmediabox(lua_State * L) +{ + lua_pushinteger(L, (pdf_omit_mediabox)); + return 1 ; +} + static int setpdfgentounicode(lua_State * L) { if (lua_type(L, 1) == LUA_TNUMBER) { @@ -852,6 +858,14 @@ static int setpdfomitinfodict(lua_State * L) return 0 ; } +static int setpdfomitmediabox(lua_State * L) +{ + if (lua_type(L, 1) == LUA_TNUMBER) { + set_pdf_omit_mediabox(lua_tointeger(L, 1)); + } + return 0 ; +} + /* for tracing purposes when no pages are flushed */ static int setforcefile(lua_State * L) @@ -1365,12 +1379,14 @@ static const struct luaL_Reg pdflib[] = { { "getomitcidset", getpdfomitcidset }, { "getomitcharset", getpdfomitcharset }, { "getomitinfo", getpdfomitinfodict }, + { "getomitmediabox", getpdfomitmediabox }, { "setinclusionerrorlevel", setpdfinclusionerrorlevel }, { "setignoreunknownimages", setpdfignoreunknownimages }, { "setgentounicode", setpdfgentounicode }, { "setomitcidset", setpdfomitcidset }, { "setomitcharset", setpdfomitcharset }, { "setomitinfo", setpdfomitinfodict }, + { "setomitmediabox", setpdfomitmediabox }, { "setforcefile", setforcefile }, { "mapfile", l_mapfile }, { "mapline", l_mapline }, diff --git a/source/texk/web2c/luatexdir/luatex.c b/source/texk/web2c/luatexdir/luatex.c index 753b8e5d3c4d4650d589aea153ac601812c32cdd..14426db6a8b7c4f2ba87873da5b1813e228ea75a 100644 --- a/source/texk/web2c/luatexdir/luatex.c +++ b/source/texk/web2c/luatexdir/luatex.c @@ -32,9 +32,9 @@ stick to "0" upto "9" so users can expect a number represented as string. */ -int luatex_version = 115; -int luatex_revision = '1'; -const char *luatex_version_string = "1.15.1"; +int luatex_version = 116; +int luatex_revision = '0'; +const char *luatex_version_string = "1.16.0"; const char *engine_name = my_name; #include <kpathsea/c-ctype.h> diff --git a/source/texk/web2c/luatexdir/luatex_svnversion.h b/source/texk/web2c/luatexdir/luatex_svnversion.h index 7e0793bdefa914ebc46cb95026dd0d6d89db23f8..a42149f4fc9ac0d9ba384ba1ec91541486c975f5 100644 --- a/source/texk/web2c/luatexdir/luatex_svnversion.h +++ b/source/texk/web2c/luatexdir/luatex_svnversion.h @@ -1,4 +1,4 @@ #ifndef luatex_svn_revision_h #define luatex_svn_revision_h -#define luatex_svn_revision 7554 +#define luatex_svn_revision 7555 #endif diff --git a/source/texk/web2c/luatexdir/pdf/pdfgen.c b/source/texk/web2c/luatexdir/pdf/pdfgen.c index bc9e14420467f53ae7dd0372fc128e53b847e5cc..52d771bc36be1d8b5faf64203c863725e2729f1b 100644 --- a/source/texk/web2c/luatexdir/pdf/pdfgen.c +++ b/source/texk/web2c/luatexdir/pdf/pdfgen.c @@ -1801,13 +1801,16 @@ void pdf_end_page(PDF pdf) pdf_dict_add_name(pdf, "Type", "Page"); pdf_dict_add_ref(pdf, "Contents", pdf->last_stream); pdf_dict_add_ref(pdf, "Resources", res_p->last_resources); - pdf_add_name(pdf, "MediaBox"); - pdf_begin_array(pdf); - pdf_add_int(pdf, 0); - pdf_add_int(pdf, 0); - pdf_add_bp(pdf, pdf->page_size.h); - pdf_add_bp(pdf, pdf->page_size.v); - pdf_end_array(pdf); + pdf->omit_mediabox = pdf_omit_mediabox; + if (! pdf->omit_mediabox) { + pdf_add_name(pdf, "MediaBox"); + pdf_begin_array(pdf); + pdf_add_int(pdf, 0); + pdf_add_int(pdf, 0); + pdf_add_bp(pdf, pdf->page_size.h); + pdf_add_bp(pdf, pdf->page_size.v); + pdf_end_array(pdf); + } page_attributes = pdf_page_attr ; if (page_attributes != null) pdf_print_toks(pdf, page_attributes); @@ -2251,6 +2254,10 @@ void pdf_finish_file(PDF pdf, int fatal_error) { } } else { if (pdf->draftmode == 0) { + pdf->gen_tounicode = pdf_gen_tounicode; + pdf->omit_cidset = pdf_omit_cidset; + pdf->omit_charset = pdf_omit_charset; + pdf->omit_infodict = pdf_omit_infodict; /*tex We make sure that the output file name has been already created. */ pdf_flush(pdf); /*tex Flush page 0 objects from JBIG2 images, if any. */ @@ -2263,13 +2270,6 @@ void pdf_finish_file(PDF pdf, int fatal_error) { check_nonexisting_destinations(pdf); check_nonexisting_structure_destinations(pdf); } - /*tex - Output fonts definition. - */ - pdf->gen_tounicode = pdf_gen_tounicode; - pdf->omit_cidset = pdf_omit_cidset; - pdf->omit_charset = pdf_omit_charset; - pdf->omit_infodict = pdf_omit_infodict; /*tex The first pass over the list will flag the slots that are used so that we can do a preroll for type 3 fonts. diff --git a/source/texk/web2c/luatexdir/pdf/pdftables.h b/source/texk/web2c/luatexdir/pdf/pdftables.h index aa9aaef96cfc43abe6fcb011e36296dc2ca6ee84..57fdec1ce9a23274dd025c4b6629a8ac2f0697e1 100644 --- a/source/texk/web2c/luatexdir/pdf/pdftables.h +++ b/source/texk/web2c/luatexdir/pdf/pdftables.h @@ -142,6 +142,7 @@ typedef enum { c_pdf_recompress, c_pdf_omit_charset, c_pdf_omit_infodict, + c_pdf_omit_mediabox, } pdf_backend_counters ; typedef enum { @@ -192,6 +193,7 @@ extern int pdf_cur_form; # define pdf_omit_cidset get_tex_extension_count_register(c_pdf_omit_cidset) # define pdf_omit_charset get_tex_extension_count_register(c_pdf_omit_charset) # define pdf_omit_infodict get_tex_extension_count_register(c_pdf_omit_infodict) +# define pdf_omit_mediabox get_tex_extension_count_register(c_pdf_omit_mediabox) # define pdf_recompress get_tex_extension_count_register(c_pdf_recompress) # define pdf_h_origin get_tex_extension_dimen_register(d_pdf_h_origin) @@ -216,6 +218,7 @@ extern int pdf_cur_form; # define set_pdf_omit_cidset(i) set_tex_extension_count_register(c_pdf_omit_cidset,i) # define set_pdf_omit_charset(i) set_tex_extension_count_register(c_pdf_omit_charset,i) # define set_pdf_omit_infodict(i) set_tex_extension_count_register(c_pdf_omit_infodict,i) +# define set_pdf_omit_mediabox(i) set_tex_extension_count_register(c_pdf_omit_mediabox,i) # define set_pdf_gen_tounicode(i) set_tex_extension_count_register(c_pdf_gen_tounicode,i) # define set_pdf_recompress(i) set_tex_extension_count_register(c_pdf_recompress,i) diff --git a/source/texk/web2c/luatexdir/pdf/pdftypes.h b/source/texk/web2c/luatexdir/pdf/pdftypes.h index 34b3322036a0b44f0a67addfd20a6e66055b1f81..f9e1d3ba347d83a822dce18ef630f242bcc28852 100644 --- a/source/texk/web2c/luatexdir/pdf/pdftypes.h +++ b/source/texk/web2c/luatexdir/pdf/pdftypes.h @@ -296,6 +296,7 @@ typedef struct pdf_output_file_ { int omit_cidset; int omit_charset; int omit_infodict; + int omit_mediabox; int inclusion_copy_font; int major_version; /* fixed major part of the PDF version */ int minor_version; /* fixed minor part of the PDF version */ diff --git a/source/texk/web2c/luatexdir/tex/textoken.c b/source/texk/web2c/luatexdir/tex/textoken.c index 026f7d6bf15ab1339e11844300248cf15520e4aa..b6f8bbb8c7c2984e7f62fb3fb23d45d2b6f827cd 100644 --- a/source/texk/web2c/luatexdir/tex/textoken.c +++ b/source/texk/web2c/luatexdir/tex/textoken.c @@ -2621,6 +2621,7 @@ static int do_variable_pdf(halfword c) else if (scan_keyword("omitcidset")) { do_variable_backend_int(c_pdf_omit_cidset); } else if (scan_keyword("omitcharset")) { do_variable_backend_int(c_pdf_omit_charset); } else if (scan_keyword("omitinfodict")) { do_variable_backend_int(c_pdf_omit_infodict); } + else if (scan_keyword("omitmediabox")) { do_variable_backend_int(c_pdf_omit_mediabox); } else if (scan_keyword("recompress")) { do_variable_backend_int(c_pdf_recompress); } else if (scan_keyword("horigin")) { do_variable_backend_dimen(d_pdf_h_origin); }