HtmlArea GetRequiredHeight seems "funny"

Skip Navigation LinksHome  /  Support  /  Forums  /  DynamicPDF CoreSuite for .NET (v10)  /  HtmlArea GetRequiredHeight seems "funny"

DynamicPDF CoreSuite for .NET (v10) Forum

I am building a PDF by adding HtmlArea boxes to the Page to the page. I am finding what feels like inconsistencies with the "GetRequiredHeight" method when used with GetOverflowHtmlArea.

I set my HtmlArea height/width to equal the page body dimensions. In one scenario, my Html content spans to the next page.  When I first create the HtmlArea and check the "GetRequiredHeight" it is returning a 1182 as the required height. This makes sense, as the page height is only 684.

I then call GetOverflowHtmlArea and it returns a new HtmlArea, as expected.

At this point, I check the GetRequiredHeight and get back 1111.  However, the thing that is confusing is that this second HtmlArea only ends up consuming about 3/4 of the page, or about 440 points.  Additionally, if I call "GetOverflowHtmlArea" it returns a null value. To me, it seems like anytime I get a null "overflow" value, the "GetRequiredHeight" value should always be less than the page's dimensions. Why does GetRequiredHeight return 1111 (a value larger than the page) when GetOverflowHtmlArea returns null?

In other scenarios, perhaps when the HtmlArea spans 3+ pages, it appears to work correctly. That is, it progressively changes until GetRequiredHeight is smaller than the page's body dimensions and the final "RequiredHeight" value will be smaller than the page.

Why does this matter? I'm trying to add more elements to the page right after the HtmlArea. However, I'm not able to correctly calculate where the top of the next element should start.

Can you shed some light on the expected behavior?

Posted by a ceTe Software moderator
Hi,

What you describe is not the expected behavior. When GetOverflowHtmlArea returns null, GetRequiredHeight should be less then or equal to the height of the HtmlArea and can be used to calculate the position of elements after the HtmlArea.

If you aren't using the latest version, please try updating to the latest version.

If you are using the latest version, please send example code to recreate this to us at support@dynamicpdf.com. We'll look into it and update this thread once we know more.

Thanks,
ceTe Software Support Team

All times are US Eastern Standard time. The time now is 12:05 PM.