J.Pietschmann wrote:

See bug #20868: ExternalGraphics.java, line 209 or so:
    int pageHeight = area.getPage().getBody().getMaxHeight()
                                    ^^^^^^^^^^^^^^^
should be something else.

J.Pietschmann

Thanks. We have looked into the bug report, and changed, after some checks, our code also to:
int pageHeight = area.spaceLeft()


Since this also gives us the most desired behavour.

We have checked it with a graphic in a block-container and with a normal positioned external graphic and it worked excactly as we wanted it to. SpaceLeft also takes margins into account, so the image is scaled to the real size that it can fill (in our case it's no longer scaled).

If the region getMaxHeight() is needed (I assume there must ge a reason why teh getPage().getBody() check is in there), perhaps the function:

area.getNearestAncestorAreaContainer()

can help out, allthough you should check if you have a parent then, since a block-container has no parent and the function does not check if the parent is set. But I don't know what the desired behavour is for a block container in this case.

Regards
Wessel van Norel


--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to