diff --git a/manual/luatex-backend.tex b/manual/luatex-backend.tex index 672288d45c116dccb57291d505ae0cd747eb86d9..2d01fcea7553318d6cd40d9ce93b6c6ca5709b53 100644 --- a/manual/luatex-backend.tex +++ b/manual/luatex-backend.tex @@ -1,4 +1,4 @@ -% language=uk +% language=us engine=luatex runpath=texruns:manuals/luatex \environment luatex-style @@ -125,7 +125,8 @@ after the \PDFTEX\ equivalents. \stopsubsection \startsubsection[title={\type {[set|get]suppressoptionalinfo}, \type {[set|get]trailerid}, -\type {[set|get]omitcidset}, \type {[set|get]omitinfo} and \type {[set|get]omitmediabox}}] +\type {[set|get]omitcidset}, \type {[set|get]omitinfo}, \type {[set|get]omitmediabox}, +\type {[set|get]omitprocset}, \type {[set|get]ptexprefix}} ] \topicindex{\PDF+options} \topicindex{\PDF+trailer} @@ -136,6 +137,8 @@ after the \PDFTEX\ equivalents. \libindex{getomitcharset} \libindex{setomitcharset} \libindex{getomitinfo} \libindex{setomitinfo} \libindex{getomitmediabox} \libindex{setomitmediabox} +\libindex{getomitprocset} \libindex{setomitprocset} +\libindex{getptexprefix} \libindex{setptexprefix} 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. @@ -145,7 +148,12 @@ array content with checksums. 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. +some of the many \PDF\ substandards. The same is true for the \type {ProcSet} and +\type {PTEX} prefix where setting this flag will force the use of a \type {_} +instead if a \type {.}. \footnote {In the info dictionary a period is valid pre +version 2, but the underscore has to be used elsewhere. The prefix dates from the +early days of \PDFTEX\ and at that time using a period was considered okay. Later +specifications clarified this.} 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. @@ -620,12 +628,12 @@ pdfe.getstatus(<pdfe document>) The returned codes are: \starttabulate[|c|l|] -\DB value \BC explanation \NC \NR +\DB value \BC explanation \NC \NR \TB -\NC \type {-2} \NC the document is (still) protected \NC \NR -\NC \type {-1} \NC the document failed to open \NC \NR -\NC \type {0} \NC the document is not encrypted \NC \NR -\NC \type {1} \NC the document has been unencrypted \NC \NR +\NC \type {-2} \NC the document is (still) protected \NC \NR +\NC \type {-1} \NC the document failed to open \NC \NR +\NC \type {0} \NC the document is not encrypted \NC \NR +\NC \type {1} \NC the document has been unencrypted \NC \NR \LL \stoptabulate @@ -653,7 +661,7 @@ bytes = getsize(<pdfe document>) major, minor = getversion(<pdfe document>) n = getnofobjects(<pdfe document>) n = getnofpages(<pdfe document>) -bytes, waste = getmemoryusage(<pdfe document>) +bytes, waste = getmemoryusage(<pdfe document>) \stoptyping \stopsubsection @@ -739,7 +747,7 @@ string is hex encoded. The second call returns the unencoded string. \stopsubsection -\startsubsection[title={\type {get[dictionary|array|stream]}}] +\startsubsection[title={\type {get[from][dictionary|array|stream]}}] \libindex {getdictionary} \libindex {getfromdictionary} \libindex {getarray} \libindex {getfromarray} @@ -775,7 +783,7 @@ print(pdfe.open("foo.pdf").Pages[1]) \stopsubsection -\startsubsection[title={\type {[open|close|readfrom|readfromwhole]stream}}] +\startsubsection[title={\type {[open|close|readfrom|whole|]stream}}] \libindex {openstream} \libindex {closestream} @@ -825,7 +833,7 @@ type, value, detail = getfromarray(<pdfe array>,index) \DB type \BC meaning \BC value \BC detail \NC \NR \NC \type {0} \NC none \NC nil \NC \NC \NR \NC \type {1} \NC null \NC nil \NC \NC \NR -\NC \type {2} \NC boolean \NC 1 or 0 \NC \NC \NR +\NC \type {2} \NC boolean \NC boolean \NC \NC \NR \NC \type {3} \NC integer \NC integer \NC \NC \NR \NC \type {4} \NC number \NC float \NC \NC \NR \NC \type {5} \NC name \NC string \NC \NC \NR diff --git a/manual/luatex-modifications.tex b/manual/luatex-modifications.tex index d28bc4fdac365b5e2bf896202e975e40559496d3..7df3389d3453ef517852ed7056bac0d5bfe0bd51 100644 --- a/manual/luatex-modifications.tex +++ b/manual/luatex-modifications.tex @@ -668,7 +668,10 @@ The configuration related registers have become: \edef\pdfomitcidset {\pdfvariable omitcidset} \edef\pdfomitcharset {\pdfvariable omitcharset} \edef\pdfomitinfodict {\pdfvariable omitinfodict} +\edef\pdfomitinfodict {\pdfvariable omitinfodict} \edef\pdfomitmediabox {\pdfvariable omitmediabox} +\edef\pdfomitprocset {\pdfvariable omitprocset} +\edef\pdfptexprefix {\pdfvariable ptexprefix} \edef\pdfpagebox {\pdfvariable pagebox} \edef\pdfminorversion {\pdfvariable minorversion} \edef\pdfuniqueresname {\pdfvariable uniqueresname} @@ -921,6 +924,8 @@ The engine sets the following defaults. \pdfomitcharset 0 \pdfomitinfodict 0 \pdfomitmediabox 0 +\pdfomitprocset 0 +\pdfptexprefix 0 \pdfpagebox 0 \pdfminorversion 4 \pdfuniqueresname 0 diff --git a/manual/luatex.pdf b/manual/luatex.pdf index f62c5ae581fded004c22a1e7118282dd6bc78bf3..824ea068bc1ce3a1181c130d2da7b22862aec3e2 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 fa0338281f5c4e14a200396d68e2e839beb3bd6d..c117101a5467b7c9291af7328de1c709484bd84a 100644 --- a/source/texk/web2c/luatexdir/ChangeLog +++ b/source/texk/web2c/luatexdir/ChangeLog @@ -1,3 +1,8 @@ +2024-05-13 Luigi Scarso <luigi.scarso@gmail.com> + * Omitprocset and ptexprefix (force _ instead of . as separator) (H.Hagen) + * Bump to version 1.18.2 + + 2024-03-25 Luigi Scarso <luigi.scarso@gmail.com> * Fixed synctex message on a math node with no zero glue diff --git a/source/texk/web2c/luatexdir/image/epdf.h b/source/texk/web2c/luatexdir/image/epdf.h index 737682d791a8164e870d81c541bd8c303cb5a94e..5e280a4ceec1d749e10afb828903382bf1a4f5ab 100644 --- a/source/texk/web2c/luatexdir/image/epdf.h +++ b/source/texk/web2c/luatexdir/image/epdf.h @@ -101,6 +101,8 @@ extern void pdf_dict_add_ref(PDF, const char *key, int num); extern void pdf_dict_add_name(PDF, const char *key, const char *val); extern void pdf_dict_add_streaminfo(PDF); +extern const char *pdf_pdf_prefix_str(const char *a, const char *b); + /* Conflict with pdfgen.h */ /*# define pdf_out(pdf, A) do { pdf_room(pdf, 1); *(pdf->buf->p++) = A; } while (0)*/ /*# define pdf_quick_out(pdf,A) *(pdf->buf->p++)=(unsigned char)(A) */ diff --git a/source/texk/web2c/luatexdir/image/pdftoepdf.c b/source/texk/web2c/luatexdir/image/pdftoepdf.c index ca68ba8dcdbe90b8e84080c1f3db52f64be07d36..315d6bdacc70c08b3879dd49d3e0c195a390f8b3 100644 --- a/source/texk/web2c/luatexdir/image/pdftoepdf.c +++ b/source/texk/web2c/luatexdir/image/pdftoepdf.c @@ -822,15 +822,12 @@ void write_epdf(PDF pdf, image_dict * idict, int suppress_optional_info) */ pdf_dict_add_img_filename(pdf, idict); if ((suppress_optional_info & 4) == 0) { - pdf_dict_add_int(pdf, "PTEX.PageNumber", (int) img_pagenum(idict)); + pdf_dict_add_int(pdf, pdf_pdf_prefix_str("PTEX_PageNumber", "PTEX.PageNumber"), (int) img_pagenum(idict)); } if ((suppress_optional_info & 8) == 0) { infoDict = ppdoc_info(pdfe); if (infoDict != NULL) { - /* todo : check this - pdf_dict_add_ref(pdf, "PTEX.InfoDict", addInObj(pdf, pdf_doc, infoDict)); - */ - pdf_add_name(pdf, "PTEX.InfoDict"); + pdf_add_name(pdf,pdf_pdf_prefix_str("PTEX_InfoDict", "PTEX.InfoDict")); copyDict(pdf, pdf_doc, infoDict); } } diff --git a/source/texk/web2c/luatexdir/image/writeimg.c b/source/texk/web2c/luatexdir/image/writeimg.c index f544e6b6814efa8b4493aad88f03e89538fc4d1f..d5988b0adf4b8271f25ec91ab832dd302b551bcf 100644 --- a/source/texk/web2c/luatexdir/image/writeimg.c +++ b/source/texk/web2c/luatexdir/image/writeimg.c @@ -735,7 +735,7 @@ void pdf_dict_add_img_filename(PDF pdf, image_dict * idict) p = img_filepath(idict); } /*tex write additional information */ - pdf_add_name(pdf, "PTEX.FileName"); + pdf_add_name(pdf, pdf_pdf_prefix_str("PTEX_FileName", "PTEX.InfoDict")); pdf_printf(pdf, " (%s)", convertStringToPDFString(p, strlen(p))); } } diff --git a/source/texk/web2c/luatexdir/image/writeimg.h b/source/texk/web2c/luatexdir/image/writeimg.h index 96771decd35fefdb8543ea2152b55330e289d471..2458b1768bbc2159155133e3c4ecb05b42387a0b 100644 --- a/source/texk/web2c/luatexdir/image/writeimg.h +++ b/source/texk/web2c/luatexdir/image/writeimg.h @@ -28,6 +28,8 @@ typedef image_dict *idict_entry; extern idict_entry *idict_array; +extern const char *pdf_pdf_prefix_str(const char *a, const char *b); + void new_img_pdfstream_struct(image_dict *); image *new_image(void); image_dict *new_image_dict(void); diff --git a/source/texk/web2c/luatexdir/lua/lpdflib.c b/source/texk/web2c/luatexdir/lua/lpdflib.c index 7cd4b8d4943c1980b38b347336151f3c13ff1744..4dd9247796c956c5d4e2309dc44984bf239cd1d7 100644 --- a/source/texk/web2c/luatexdir/lua/lpdflib.c +++ b/source/texk/web2c/luatexdir/lua/lpdflib.c @@ -17,7 +17,6 @@ You should have received a copy of the GNU General Public License along with LuaTeX; if not, see <http://www.gnu.org/licenses/>. */ - #include "ptexlib.h" #include "lua/luatex-api.h" #include "pdf/pdftables.h" @@ -826,6 +825,18 @@ static int getpdfomitmediabox(lua_State * L) return 1 ; } +static int getpdfomitprocset(lua_State * L) +{ + lua_pushinteger(L, (pdf_omit_procset)); + return 1 ; +} + +static int getpdfptexprefix(lua_State * L) +{ + lua_pushinteger(L, (pdf_ptex_prefix)); + return 1 ; +} + static int setpdfgentounicode(lua_State * L) { /* ensures that glyph_unicode_tree is not null */ @@ -868,6 +879,22 @@ static int setpdfomitmediabox(lua_State * L) return 0 ; } +static int setpdfomitprocset(lua_State * L) +{ + if (lua_type(L, 1) == LUA_TNUMBER) { + set_pdf_omit_procset(lua_tointeger(L, 1)); + } + return 0 ; +} + +static int setpdfptexprefix(lua_State * L) +{ + if (lua_type(L, 1) == LUA_TNUMBER) { + set_pdf_ptex_prefix(lua_tointeger(L, 1)); + } + return 0 ; +} + /* for tracing purposes when no pages are flushed */ static int setforcefile(lua_State * L) @@ -1382,6 +1409,8 @@ static const struct luaL_Reg pdflib[] = { { "getomitcharset", getpdfomitcharset }, { "getomitinfo", getpdfomitinfodict }, { "getomitmediabox", getpdfomitmediabox }, + { "getomitprocset", getpdfomitprocset }, + { "getptexprefix", getpdfptexprefix }, { "setinclusionerrorlevel", setpdfinclusionerrorlevel }, { "setignoreunknownimages", setpdfignoreunknownimages }, { "setgentounicode", setpdfgentounicode }, @@ -1389,6 +1418,8 @@ static const struct luaL_Reg pdflib[] = { { "setomitcharset", setpdfomitcharset }, { "setomitinfo", setpdfomitinfodict }, { "setomitmediabox", setpdfomitmediabox }, + { "setomitprocset", setpdfomitprocset }, + { "setptexprefix", setpdfptexprefix }, { "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 0b4158518faebf0d8da3f7e25da7d8c472445af7..9ad8c1bf45f537186904142c3d001f8d44311469 100644 --- a/source/texk/web2c/luatexdir/luatex.c +++ b/source/texk/web2c/luatexdir/luatex.c @@ -33,8 +33,8 @@ */ int luatex_version = 118; -int luatex_revision = '1'; -const char *luatex_version_string = "1.18.1"; +int luatex_revision = '2'; +const char *luatex_version_string = "1.18.2"; 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 3c9c8fdead35f8734c94b779e3b0858342a09850..ae5255b50ef1448ce9fb42ea8013c57e4cdd03e4 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 7619 +#define luatex_svn_revision 7620 #endif diff --git a/source/texk/web2c/luatexdir/pdf/pdfgen.c b/source/texk/web2c/luatexdir/pdf/pdfgen.c index 076b324e3347b6fa12a409fa8f62cea247978a16..61dfbec1540b4d88be81a9718cc95373da8e68b1 100644 --- a/source/texk/web2c/luatexdir/pdf/pdfgen.c +++ b/source/texk/web2c/luatexdir/pdf/pdfgen.c @@ -2020,7 +2020,7 @@ void pdf_end_page(PDF pdf) pdf_end_dict(pdf); } /*tex Generate |ProcSet| in version 1.*/ - if (pdf->major_version == 1) { + if (pdf->major_version == 1 && ! pdf_omit_procset) { pdf_add_name(pdf, "ProcSet"); pdf_begin_array(pdf); if ((procset & PROCSET_PDF) != 0) @@ -2130,6 +2130,11 @@ static boolean substr_of_str(const char *s, const char *t) return true; } +const char* pdf_pdf_prefix_str(const char *a, const char *b) +{ + return (pdf_ptex_prefix ? a : b); +} + static int pdf_print_info(PDF pdf, int luatexversion, str_number luatexrevision) { boolean creator_given = false; @@ -2195,7 +2200,7 @@ static int pdf_print_info(PDF pdf, int luatexversion, str_number luatexrevision) pdf_dict_add_name(pdf, "Trapped", "False"); } if ((pdf_suppress_optional_info & 1) == 0) { - pdf_dict_add_string(pdf, "PTEX.FullBanner", luatex_banner); + pdf_dict_add_string(pdf, pdf_pdf_prefix_str("PTEX_FullBanner", "PTEX.FullBanner"), luatex_banner); } pdf_end_dict(pdf); pdf_end_obj(pdf); diff --git a/source/texk/web2c/luatexdir/pdf/pdfgen.h b/source/texk/web2c/luatexdir/pdf/pdfgen.h index 00df7f36ed353607f65d873c260b4946ba176c95..42c9361d179fd881da47934af5156b1fba2f9f09 100644 --- a/source/texk/web2c/luatexdir/pdf/pdfgen.h +++ b/source/texk/web2c/luatexdir/pdf/pdfgen.h @@ -251,5 +251,8 @@ extern void pdf_set_reference_point(PDF pdf, posstructure *refpoint); extern void check_o_mode(PDF pdf, const char *s, int o_mode, boolean errorflag); extern void ensure_output_file_open(PDF pdf, const char *ext); +/* PTEX prefix */ +extern const char *pdf_pdf_prefix_str(const char *a, const char *b); + #endif diff --git a/source/texk/web2c/luatexdir/pdf/pdflink.c b/source/texk/web2c/luatexdir/pdf/pdflink.c index ed908e6456cb51ea4b7b83b721da5c03e9326e33..db154ce9483dfeaf4a46ba3158c5d2ba2cd790f3 100644 --- a/source/texk/web2c/luatexdir/pdf/pdflink.c +++ b/source/texk/web2c/luatexdir/pdf/pdflink.c @@ -122,7 +122,7 @@ void end_link(PDF pdf, halfword p) pdf_ann_left(q) = pos.h; if (pdf_ann_left(q) > pdf_ann_right(q)) { halfword r = pdf_ann_right(q); - halfword l = pdf_ann_left(q); + /* halfword l = pdf_ann_left(q); */ pdf_ann_right(q) = pos.h - r; pdf_ann_left(q) = pos.h; } diff --git a/source/texk/web2c/luatexdir/pdf/pdftables.h b/source/texk/web2c/luatexdir/pdf/pdftables.h index 578b44aa7788a455cc9cb43dec776877f7961624..e3878aea1026efe25f08d2ee4a03e9086d14c9ea 100644 --- a/source/texk/web2c/luatexdir/pdf/pdftables.h +++ b/source/texk/web2c/luatexdir/pdf/pdftables.h @@ -144,6 +144,8 @@ typedef enum { c_pdf_omit_infodict, c_pdf_omit_mediabox, c_pdf_linking, + c_pdf_omit_procset, + c_pdf_ptex_prefix, } pdf_backend_counters ; typedef enum { @@ -197,6 +199,8 @@ extern int pdf_cur_form; # 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_linking get_tex_extension_count_register(c_pdf_linking) +# define pdf_omit_procset get_tex_extension_count_register(c_pdf_omit_procset) +# define pdf_ptex_prefix get_tex_extension_count_register(c_pdf_ptex_prefix) # define pdf_h_origin get_tex_extension_dimen_register(d_pdf_h_origin) # define pdf_v_origin get_tex_extension_dimen_register(d_pdf_v_origin) @@ -224,6 +228,8 @@ extern int pdf_cur_form; # 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) # define set_pdf_linking(i) set_tex_extension_count_register(c_pdf_linking,i) +# define set_pdf_omit_procset(i) set_tex_extension_count_register(c_pdf_omit_procset,i) +# define set_pdf_ptex_prefix(i) set_tex_extension_count_register(c_pdf_ptex_prefix,i) # define set_pdf_decimal_digits(i) set_tex_extension_count_register(c_pdf_decimal_digits,i) # define set_pdf_pk_resolution(i) set_tex_extension_count_register(c_pdf_pk_resolution,i) diff --git a/source/texk/web2c/luatexdir/tex/textoken.c b/source/texk/web2c/luatexdir/tex/textoken.c index 4abe6377b551bac78431d9f3a91182874e8f9aed..a1f0c230923b2503a46d0efe248f67b336518ddb 100644 --- a/source/texk/web2c/luatexdir/tex/textoken.c +++ b/source/texk/web2c/luatexdir/tex/textoken.c @@ -2624,6 +2624,8 @@ static int do_variable_pdf(halfword c) 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("linking")) { do_variable_backend_int(c_pdf_linking); } + else if (scan_keyword("omitprocset")) { do_variable_backend_int(c_pdf_omit_procset); } + else if (scan_keyword("ptexprefix")) { do_variable_backend_int(c_pdf_ptex_prefix); } else if (scan_keyword("horigin")) { do_variable_backend_dimen(d_pdf_h_origin); } else if (scan_keyword("vorigin")) { do_variable_backend_dimen(d_pdf_v_origin); }