lmi
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lmi] PDF pagination


From: Vadim Zeitlin
Subject: [lmi] PDF pagination
Date: Mon, 19 Feb 2018 13:50:29 +0100

 Hello,

 There are several problems with implementing real pagination in PDF
generation code, but the first one of them is that there is simply not
enough information to do it correctly currently: the template, such as
reg_d_indiv_notes1.mst, doesn't contain anything that could be used to
deduce what should be output in the beginning of the new page. In fact, I
don't even know it myself, but I'm almost sure that the logo should be
repeated on each extra page and I suspect that the "Explanatory Notes"
header should be present on subsequent pages as well -- but there is just
no way to tell, programmatically.

 Worse, I wonder if the subsequent pages don't need something like
"Explanatory Notes (continued)" header which would be even more impossible
to generate automatically.

 So I think that we may need to change the 1-to-1 relationship between
(logical) pages and their templates and have separate templates for the
header and the body of every page and, if my suspicion about the need to
use a different header for the continuation pages is correct, also another
template for the headers of the extra pages. I.e. instead of just
reg_d_indiv_notes1.mst, we'd have reg_d_indiv_notes1_header.mst,
reg_d_indiv_notes1_body.mst and, maybe, reg_d_indiv_notes1_header_cont.mst.

 This is obviously rather heavy and inconvenient, but I just don't see what
else can we do. If the headers were the same for all the pages, we might be
able to use some <fixed_end/> pseudo-tag in the template and then split the
single file into parts before and after this tag (although I'm not sure how
to do it with wxHTML right now), but if the header needs to vary, even this
wouldn't be enough.

 Can you see any better approach or should I do it like this and start
working on the pagination logic itself (which doesn't look like a very
simple problem neither, but should be doable...)?

 Thanks in advance,
VZ


reply via email to

[Prev in Thread] Current Thread [Next in Thread]