diff --git a/manual/luatex-backend.tex b/manual/luatex-backend.tex index c2479238f3cb3827ce3ad07fe417bdadb7310d54..4c6c36bd7baa4962c4c6529beefacfdd2c318276 100644 --- a/manual/luatex-backend.tex +++ b/manual/luatex-backend.tex @@ -124,8 +124,8 @@ after the \PDFTEX\ equivalents. \stopsubsection -\startsubsection[title={\type {[set|get]suppressoptionalinfo}, \type {[set|get]trailerid} -and \type {[set|get]omitcidset}}] +\startsubsection[title={\type {[set|get]suppressoptionalinfo}, \type {[set|get]trailerid}, +\type {[set|get]omitcidset} and \type {[set|get]omitinfodict}}] \topicindex{\PDF+options} \topicindex{\PDF+trailer} @@ -134,6 +134,7 @@ and \type {[set|get]omitcidset}}] \libindex{gettrailerid} \libindex{settrailerid} \libindex{getomitcidset} \libindex{setomitcidset} \libindex{getomitcharset} \libindex{setomitcharset} +\libindex{getomitinfodict} \libindex{setomitinfodict} 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. @@ -141,9 +142,9 @@ By default we flush all. See \in {section} [sec:pdfextensions] for more details. You can set your own trailer id. This has to be string containing valid \PDF\ array content with checksums. -The cidset and charset 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. +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. \stopsubsection @@ -639,6 +640,7 @@ pdfe.unencrypt(<pdfe document>,userpassword,ownerpassword) \libindex {getversion} \libindex {getnofobjects} \libindex {getnofpages} +\libindex {getmemoryusage} A successfully opened document can provide some information: diff --git a/manual/luatex-math.tex b/manual/luatex-math.tex index 4ab65fa188c2955717d92414c327b7de8b4fead5..56139cde9d920c3cc08de75d568cdfce0b0ee234 100644 --- a/manual/luatex-math.tex +++ b/manual/luatex-math.tex @@ -1,4 +1,4 @@ -% language=us engine=luatex runpath=texruns:manuals/luatex +% language=uk engine=luatex runpath=texruns:manuals/luatex \environment luatex-style diff --git a/manual/luatex-modifications.tex b/manual/luatex-modifications.tex index caf643913f4fe14cf1a4f9b6e2f34ca113c417b0..e3edc59f79e5b6583d67138812cadd0a996b2369 100644 --- a/manual/luatex-modifications.tex +++ b/manual/luatex-modifications.tex @@ -1,4 +1,4 @@ -% language=us engine=luatex runpath=texruns:manuals/luatex +% language=uk engine=luatex runpath=texruns:manuals/luatex \environment luatex-style @@ -666,6 +666,7 @@ The configuration related registers have become: \edef\pdfgentounicode {\pdfvariable gentounicode} \edef\pdfomitcidset {\pdfvariable omitcidset} \edef\pdfomitcharset {\pdfvariable omitcharset} +\edef\pdfomitinfodict {\pdfvariable omitinfodict} \edef\pdfpagebox {\pdfvariable pagebox} \edef\pdfminorversion {\pdfvariable minorversion} \edef\pdfuniqueresname {\pdfvariable uniqueresname} @@ -915,6 +916,7 @@ The engine sets the following defaults. \pdfgentounicode 0 \pdfomitcidset 0 \pdfomitcharset 0 +\pdfomitinfodict 0 \pdfpagebox 0 \pdfminorversion 4 \pdfuniqueresname 0 diff --git a/manual/luatex.pdf b/manual/luatex.pdf index 073a9e5dde6b01ca121ffb457f949db8b67f6e13..354a4e27f7c874dca14d2e7e3418d50c3f743c43 100644 Binary files a/manual/luatex.pdf and b/manual/luatex.pdf differ diff --git a/source/texk/web2c/luatexdir/ChangeLog b/source/texk/web2c/luatexdir/ChangeLog index 622d610e6aa94d997e6cc6d56a53b5d9e8e57980..06fa269e47d7e15af6c99bb9d4344de1c17c0e05 100644 --- a/source/texk/web2c/luatexdir/ChangeLog +++ b/source/texk/web2c/luatexdir/ChangeLog @@ -1,5 +1,6 @@ 2022-08-16 Luigi Scarso <luigi.scarso@gmail.com> * Accent 0xFFFD but still error on invalid utf (compatible) (H.Hagen) + * omitinfodict added: \pdfvariable omitinfodict 1 omit Info dicttionary (H.Hagen) 2022-08-05 Luigi Scarso <luigi.scarso@gmail.com> * Fixed a missed lua_settop in lua_appendtovlist_callback() (thanks to Hironori KITAGAWA) diff --git a/source/texk/web2c/luatexdir/lua/lpdflib.c b/source/texk/web2c/luatexdir/lua/lpdflib.c index 6396baa92ccc8a7cccae840857abb9547625f184..057af5ea6f39a677fd39f4441d11055b904f13d1 100644 --- a/source/texk/web2c/luatexdir/lua/lpdflib.c +++ b/source/texk/web2c/luatexdir/lua/lpdflib.c @@ -814,6 +814,12 @@ static int getpdfomitcharset(lua_State * L) return 1 ; } +static int getpdfomitinfodict(lua_State * L) +{ + lua_pushinteger(L, (pdf_omit_infodict)); + return 1 ; +} + static int setpdfgentounicode(lua_State * L) { if (lua_type(L, 1) == LUA_TNUMBER) { @@ -838,6 +844,14 @@ static int setpdfomitcharset(lua_State * L) return 0 ; } +static int setpdfomitinfodict(lua_State * L) +{ + if (lua_type(L, 1) == LUA_TNUMBER) { + set_pdf_omit_infodict(lua_tointeger(L, 1)); + } + return 0 ; +} + /* for tracing purposes when no pages are flushed */ static int setforcefile(lua_State * L) @@ -1350,11 +1364,13 @@ static const struct luaL_Reg pdflib[] = { { "getgentounicode", getpdfgentounicode }, { "getomitcidset", getpdfomitcidset }, { "getomitcharset", getpdfomitcharset }, + { "getomitinfo", getpdfomitinfodict }, { "setinclusionerrorlevel", setpdfinclusionerrorlevel }, { "setignoreunknownimages", setpdfignoreunknownimages }, { "setgentounicode", setpdfgentounicode }, { "setomitcidset", setpdfomitcidset }, { "setomitcharset", setpdfomitcharset }, + { "setomitinfo", setpdfomitinfodict }, { "setforcefile", setforcefile }, { "mapfile", l_mapfile }, { "mapline", l_mapline }, diff --git a/source/texk/web2c/luatexdir/luatex_svnversion.h b/source/texk/web2c/luatexdir/luatex_svnversion.h index 7c6b3a26328e3820ebd67ab77b066e0420df8ebb..d513865325ace8f755a903eea9a23b83edcc3550 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 7537 +#define luatex_svn_revision 7538 #endif diff --git a/source/texk/web2c/luatexdir/pdf/pdfgen.c b/source/texk/web2c/luatexdir/pdf/pdfgen.c index 9ed47cc9e7345037e0c935e4b09e544d39ae14e1..bc9e14420467f53ae7dd0372fc128e53b847e5cc 100644 --- a/source/texk/web2c/luatexdir/pdf/pdfgen.c +++ b/source/texk/web2c/luatexdir/pdf/pdfgen.c @@ -2227,7 +2227,8 @@ void pdf_finish_file(PDF pdf, int fatal_error) { print_err(" ==> Fatal error occurred, no output PDF file produced!"); } else { int i, j, k; - int root, info; + int root = 0; + int info = 0; int xref_stm = 0; int outlines = 0; int threads = 0; @@ -2268,6 +2269,7 @@ void pdf_finish_file(PDF pdf, int fatal_error) { 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. @@ -2384,7 +2386,8 @@ void pdf_finish_file(PDF pdf, int fatal_error) { print_pdf_table_string(pdf, "catalog"); pdf_end_dict(pdf); pdf_end_obj(pdf); - info = pdf_print_info(pdf, luatexversion, luatexrevision); + if (! pdf->omit_infodict) + info = pdf_print_info(pdf, luatexversion, luatexrevision); if (pdf->os_enable) { pdf_buffer_select(pdf, OBJSTM_BUF); pdf_os_write_objstream(pdf); @@ -2418,7 +2421,8 @@ void pdf_finish_file(PDF pdf, int fatal_error) { pdf_add_int(pdf, 1); pdf_end_array(pdf); pdf_dict_add_ref(pdf, "Root", root); - pdf_dict_add_ref(pdf, "Info", info); + if (! pdf->omit_infodict) + pdf_dict_add_ref(pdf, "Info", info); if (pdf_trailer_toks != null) { pdf_print_toks(pdf, pdf_trailer_toks); delete_token_ref(pdf_trailer_toks); @@ -2476,7 +2480,8 @@ void pdf_finish_file(PDF pdf, int fatal_error) { pdf_begin_dict(pdf); pdf_dict_add_int(pdf, "Size", pdf->obj_ptr + 1); pdf_dict_add_ref(pdf, "Root", root); - pdf_dict_add_ref(pdf, "Info", info); + if (! pdf->omit_infodict) + pdf_dict_add_ref(pdf, "Info", info); if (pdf_trailer_toks != null) { pdf_print_toks(pdf, pdf_trailer_toks); delete_token_ref(pdf_trailer_toks); diff --git a/source/texk/web2c/luatexdir/pdf/pdftables.h b/source/texk/web2c/luatexdir/pdf/pdftables.h index 5eb9eb86d094d0f553ad16646ceb504fe843e3b3..aa9aaef96cfc43abe6fcb011e36296dc2ca6ee84 100644 --- a/source/texk/web2c/luatexdir/pdf/pdftables.h +++ b/source/texk/web2c/luatexdir/pdf/pdftables.h @@ -141,6 +141,7 @@ typedef enum { c_pdf_omit_cidset, c_pdf_recompress, c_pdf_omit_charset, + c_pdf_omit_infodict, } pdf_backend_counters ; typedef enum { @@ -190,6 +191,7 @@ extern int pdf_cur_form; # define pdf_suppress_optional_info get_tex_extension_count_register(c_pdf_suppress_optional_info) # 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_recompress get_tex_extension_count_register(c_pdf_recompress) # define pdf_h_origin get_tex_extension_dimen_register(d_pdf_h_origin) @@ -213,6 +215,7 @@ extern int pdf_cur_form; # define set_pdf_obj_compress_level(i) set_tex_extension_count_register(c_pdf_obj_compress_level,i) # 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_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 76bc69916b0d7d8f64e09a9a3e30206c2ac4233d..34b3322036a0b44f0a67addfd20a6e66055b1f81 100644 --- a/source/texk/web2c/luatexdir/pdf/pdftypes.h +++ b/source/texk/web2c/luatexdir/pdf/pdftypes.h @@ -295,6 +295,7 @@ typedef struct pdf_output_file_ { int gen_tounicode; int omit_cidset; int omit_charset; + int omit_infodict; 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 ddf91b2b0c21a3797136905663f6bda75470761a..026f7d6bf15ab1339e11844300248cf15520e4aa 100644 --- a/source/texk/web2c/luatexdir/tex/textoken.c +++ b/source/texk/web2c/luatexdir/tex/textoken.c @@ -2620,6 +2620,7 @@ static int do_variable_pdf(halfword c) else if (scan_keyword("suppressoptionalinfo")) { do_variable_backend_int(c_pdf_suppress_optional_info); } 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("recompress")) { do_variable_backend_int(c_pdf_recompress); } else if (scan_keyword("horigin")) { do_variable_backend_dimen(d_pdf_h_origin); }