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 Jeremias Maerki <de...@greenmail.ch> on 2005/06/10 16:25:54 UTC

Changing available BPD between pages

Just to let you guys know what I'm currently working on:
Currently, the page breaking takes the region-body BPD of the first page
in a sequence as the BPD for all pages. Obviously, this value can change
from page to page depending on the page-master in use. I've already
solved this particular problem insofar that I've implemented
PageBreakingAlgorithm.getLineWidth() to return an individual BPD for
each page. The line width in the page breaking context is the available
BPD. That comes from using the same base class for both line and page
breaking.

Furthermore, a "PageViewportProvider" is precreating PageViewports for
the page breaking process as this runs before the PSLM.makeNewPage()
calls. makeNewPage() also accesses PVs through the PVProvider, but then
gets the cached ones. That works fine as long as there are no breaks with
an even or odd setting which results in blank pages. But when this
happens I run into problems because the page breaking process may
request more PVs than are really used in the end, so when the break is
handled a call to makeNewPage requests a blank page at the position
where the Provider already preallocated a non-blank page for the run
over the previous element-list. But since the PageSequenceMaster is a
stateful beast that can currently only iterate in one direction I'm in
trouble. Next week I'll research a good way to reset or run backwards
the PageSequenceMaster so the already created PV in the Provider can
ultimately be replaced with a PV for a blank page.

Similar things will be necessary when we get to page-position="last"
handling but I won't break my head over that just now.

My current code currently fixes half of the normal-breaking4 test case
but I won't commit it since it breaks other test cases such as breaks*.
Half the test case means that I'm only looking at changing BPD right now,
not at changing IPD which is more complicated as the line-breaking has
to be redone.

Jeremias Maerki


Re: Changing available BPD between pages

Posted by "J.Pietschmann" <j3...@yahoo.de>.
Glen Mazza wrote:
> Yes, making PageSequenceMaster flexible--bidirectional, resettable, directly
> accessable in a static manner for any given page,

The latter would be tricky, at least because of page masters for blank
pages. Backtracking N pages should be possible though.

J.Pietschmann

Re: Changing available BPD between pages

Posted by Glen Mazza <gr...@verizon.net>.
----- Original Message ----- 
>
> But since the PageSequenceMaster is a
> stateful beast that can currently only iterate in one direction I'm in
> trouble. Next week I'll research a good way to reset or run backwards
> the PageSequenceMaster so the already created PV in the Provider can
> ultimately be replaced with a PV for a blank page.
>

Yes, making PageSequenceMaster flexible--bidirectional, resettable, directly
accessable in a static manner for any given page, etc--would be a very nice
idea, and would result in downstream PSLM logic being much easier.  I
recommend improving PSM first so your subsequent layout work would be
simpler.

Glen