summaryrefslogtreecommitdiff
path: root/Build/source/texk/web2c/luatexdir/pdf/pdfgen.w
diff options
context:
space:
mode:
Diffstat (limited to 'Build/source/texk/web2c/luatexdir/pdf/pdfgen.w')
-rw-r--r--Build/source/texk/web2c/luatexdir/pdf/pdfgen.w23
1 files changed, 8 insertions, 15 deletions
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);