Discussion:
Patch to pdfobj.c
(too old to reply)
Simon Cozens
2018-10-05 10:17:31 UTC
Permalink
Hi!

I'm never sure who to contact about dvipdfm-x and associated code, but
here is a patch which allows the PDF functions to be used more than once
in an application. Nothing reset the byte counters, meaning that when
the xref tables were written for PDFs after the first one, the numbers
would be garbage:

diff --git a/pdfobj.c b/pdfobj.c
index 8323849..4b22662 100644
--- a/pdfobj.c
+++ b/pdfobj.c
@@ -455,6 +455,8 @@ pdf_out_flush (void)
MESG("%ld bytes written", pdf_output_file_position);

MFCLOSE(pdf_output_file);
+ pdf_output_file_position = 0;
+ pdf_output_line_position = 0;
}
}
Karl Berry
2018-10-05 20:49:44 UTC
Permalink
I'm never sure who to contact about dvipdfm-x and associated code

Theoretically, tex-***@tug.org, but it's ok to mail here instead. There is
no dvipdfmx-specific list.

+ pdf_output_file_position = 0;
+ pdf_output_line_position = 0;

Seems like doing the assignment once should suffice :).

I expect Akira or one of the other dvipdfmx developers will apply it
shortly if there's no problems. --thanks, karl.
Reinhard Kotucha
2018-10-05 21:38:58 UTC
Permalink
Post by Simon Cozens
+ pdf_output_file_position = 0;
+ pdf_output_line_position = 0;
Seems like doing the assignment once should suffice :).
The assignments are different. Unfortunately C doesn't support brace
expansion:

pdf_output_{file,line}_position = 0;

Regards,
Reinhard
--
------------------------------------------------------------------
Reinhard Kotucha Phone: +49-511-3373112
Marschnerstr. 25
D-30167 Hannover mailto:***@web.de
------------------------------------------------------------------
Akira Kakuto
2018-10-07 09:12:59 UTC
Permalink
Post by Karl Berry
I expect Akira or one of the other dvipdfmx developers will apply it
shortly if there's no problems.
Applied in r48850 in accordance with the author's approval.
Many thanks Simon.

Best,
Akira

Loading...