Hello Andreas,

Only the offset of the regionViewport in question needs to be altered

(decrease by Integer.MAX_VALUE - PBP.difference? Something like

that...?)


yes, and that's exactly what I don' t get to work.

Where to put it (finishPart or finishPage) is a different story. Putting this into "my" finishPage:

            Rectangle2D rect = curPage.getPageViewport().getViewArea();           
            RegionReference after = curPage.getPageViewport().getPage().getRegionViewport(
                    Constants.FO_REGION_AFTER).getRegionReference();
            Rectangle2D afterRect = after.getRegionViewport().getViewArea();
            after.getRegionViewport().getViewArea().setRect(
                    afterRect.getX(), rect.getY() + height, afterRect.getWidth(), afterRect.getHeight());
           
            height += after.getRegionViewport().getViewArea().getHeight();
            curPage.getPageViewport().getViewArea().setRect(rect.getX(), rect.getY(), rect.getWidth(), height);

results in a obviously correct page size (including correct margins), but nevertheless the xsl-region-after block doesn't show up. What I'm looking for is indeed a simple and working way of setting the "offset" of the after region.

Further more: The reason why I tried to put this code into finishPage instead of finishPart:
- I couldn't find out why Integer.MAX_VALUE doesn't work. The resulting length is off by 10000000 and I looked for "10000000" only finding this.add(new KnuthGlue(0, 10000000, 0, null, false)); in AbstractBreaker. Coincidence or actually the reason for some integer overflow? Returning Integer.MAX_VALUE - 2 * 10000000 as q&d check didn't work either.
- Putting it into finishPart to me looks a little like a hack using implementation specifics. For me, finishPage is a more "public" point to perform the page size adjustment. But well, I'm not accustomed to the architecture and style yet to judge this. Perhaps a cleaner way would be to add something like getUsedBPD() to BodyRegion to decouple the dependencies.

Regards,
Walter

Reply via email to