Chris Bowditch wrote:

FOP Devs,

I would appreciate some advice. I have noticed that top/bottom borders dont work on regular blocks. This is because the PDF Renderer uses block.getWidth() to determine the length of the border lines. Here is a sinnper of Area Tree output:

<block width="138897" ipd="0" height="274960">
<block width="0" ipd="138897" height="250351">
<block width="0" ipd="138897" height="250351">
<block width="0" ipd="138897" height="22000">
<lineArea height="22000">
<text tsadjust="0" props="font-size:20000;font-family:F5;color:#000000;">Home Insurance</text>

Notice how ipd=0 for the top level (static content) block and then width and ipd swap around for regular fo:blocks. Question is, is this wrong, or should the PDF Renderer be changed to consider either IPD or width properties of block?

I think I have solved this mystery. The second level block shown above was a BC with the optional width property not specified. The assigning of width/ipd for a block is done in Block.getParentArea where IPD is always copied and width is based on either IPD or parent width. I have modified this logic a bit so that if the parent width is used, it will fall back to IPD if it is zero.

It fixes my problem, but I'll wait for any comments before committing this change.


Reply via email to