You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-dev@xmlgraphics.apache.org by Jan Tosovsky <j....@email.cz> on 2015/08/02 15:04:52 UTC

Multi-pass processing

On 2015-07-25 Andreas Delmelle wrote:
>
> https://issues.apache.org/jira/browse/FOP-1162
>
> Replacing the fo:page-number-citations with literal numbers 
> demonstrates that it is definitely related to the use of those. 
> That introduces an additional stretchable piece of content, 
> where the real optimum width is not known at the point where 
> the line breaks have to be determined.
> 
> If the TOC were placed at the end of the document in its own page-
> sequence, the problem would go away, as all the effective page numbers
> are known at that point.
> 

It is obvious this cannot be handled correctly without multi-pass
processing. It should be triggered if there is any
page-number-citation[-last] pointing to the unprocessed ID and repeated
until the PageViewport list for two consecutive runs return the same result.

That PageViewport list could be stored and returned by FormattingResults,
passed to the next run and preferably used for retrieving yet unprocessed
IDs. The PageViewport list has to be updated as the (possible) difference in
digit number of the page number can lead to overflowing to the next page. 

>From my perspective, page number citations are used in books, papers,
technical documentation, where FOP performance is not so crucial as for bank
statements, so any related performace hit is acceptable here.

Or is there any flaw in this theory?

Jan