From 97d03159fd78ed23db6984ba6432436f0982456c Mon Sep 17 00:00:00 2001 From: Akira Kakuto Date: Sun, 3 Apr 2016 23:16:04 +0000 Subject: web2c/luatexdir: revert git-svn-id: svn://tug.org/texlive/trunk@40228 c570f23f-e606-0410-a88d-b1316a301751 --- Build/source/texk/web2c/luatexdir/pdf/pdfgen.w | 23 ++++++++--------------- 1 file changed, 8 insertions(+), 15 deletions(-) (limited to 'Build/source/texk/web2c/luatexdir/pdf/pdfgen.w') diff --git a/Build/source/texk/web2c/luatexdir/pdf/pdfgen.w b/Build/source/texk/web2c/luatexdir/pdf/pdfgen.w index 5f6756b1e7d..c5db4c71413 100644 --- a/Build/source/texk/web2c/luatexdir/pdf/pdfgen.w +++ b/Build/source/texk/web2c/luatexdir/pdf/pdfgen.w @@ -1427,25 +1427,17 @@ difficult, we start with a simpler implementation using just the first two items @c - -/* - A user supplied trailerid had better be an array! So maybe we need to check - for [] and error otherwise. -*/ - static void print_ID(PDF pdf) { if ((pdf_suppress_optional_info & 512) == 0) { - const char *p = NULL; - pdf_add_name(pdf, "ID"); - p = get_pdf_table_string("trailerid"); - if (p && strlen(p) > 0) { - pdf_puts(pdf,p); - } else if (pdf_trailer_id != 0) { - /* user provided one */ - pdf_print_toks(pdf, pdf_trailer_id); + if (pdf_trailer_id != 0) { + char *s = NULL; + int len; + s = tokenlist_to_cstring(pdf_trailer_id, true, &len); + /* this had better be an array! sp maybe we need to check for [] and error otherwise */ + pdf_add_name(pdf, "ID"); + pdf_out_block(pdf,s,len); } else { - /* system provided one */ time_t t; size_t size; char time_str[32]; @@ -1481,6 +1473,7 @@ static void print_ID(PDF pdf) md5_finish(&state, digest); /* write the IDs */ convertStringToHexString((char *) digest, id, 16); + pdf_add_name(pdf, "ID"); pdf_begin_array(pdf); pdf_printf(pdf, "<%s> <%s>", id, id); pdf_end_array(pdf); -- cgit v1.2.3