On Feb 19, 2006, at 16:19, Walter Bauer wrote:
Hi Walter,
I'm wondering what happened to the indefinite page-height feature.
Andreas L Delmelle had some thoughts on that topic last September.
Well, I need this feature and would like to bring it into life.
I didn't quite get around to that (apart from some work on the
properties' side).
As a first test, I hacked
curPage.getPageViewport().getViewArea().setFrame(10, 10, 200*1000,
200*1000);
into PageSequenceLayoutManager.finishPage and the resulting PDF
page size was as expected.
This goes exactly into the direction I wanted to move. As I recall,
Luca pointed out that something like that would best be done in
PageSequenceLM.PageBreaker.finishPart(), since in there you have
immediate access to the PageBreakPosition (accumulated BPD =
pbp.difference).
The idea was to create a PageVP with height set to Integer.MAX_SIZE,
and then reset the height to the accumulated block-progression-
dimension when finishing the page. (This is currently not the case:
check org.apache.fop.area.PageViewport constructor. The width and
height are both unconditionally taken from the SimplePageMaster w/o
checking for indefinite sizes...)
As such, the layoutengine would receive a value of (Integer.MAX_SIZE
- accumulated BPD) upon every call to getAvailableBPD() and would
only generate a page-break in case you have more than
Integer.MAX_SIZE mpt of content --which would most likely lead to
memory running out.
This would only be part of the work. The same change --resetting the
height-- would need to be done for the BodyRegion's RegionViewport,
as well as those for the region-start and region-end (since they got
their virtually infinite height from the parent PageViewport).
Finally, the offset for the region-after should also be changed, or
it would end up outside the viewport.
As I remember, that's as far as I got. Unfortunately, lost most of my
changes to the related source code :-(
Another point to remain vigilant about (see earlier in this same
thread) is the use of percentage values as region-dimensions...
If you're willing to work any further on this, and need more info on
how to proceed, just yell. I'd be glad to work with you on this one.
Cheers,
Andreas