tAdvPdfLib : Curious behavior with DrawHTMLText and paging set to True

HI

Again about tAdvPdfLib.

I guess it is a curious behavior.

When I try to write at the end of a "writable" page (PageHeight - FooterSize) with DrawHTMLText. This command :

Pdf.Graphics.DrawHTMLText(
Chaine,
RectF( Marge + MillimeterToPixel( 5 ),
PageHeight - FooterSize - 20, // very close to the end of the page
Marge_Droite,
PageHeight - FooterSize ),
True, // Pagging
1, False);

The text is supposed goes to the next page. He does, but within the same text block as DrawHTMLText indicate. Thus, at the end, there is many pages with 1-2 lines of text at the end of the page => curious. According to me, the remainting text (HeaderSize + xx) should be send at the top of the next page, no ?

Moreover, when paging is set to false, the text continue inside the footer ?? According to me, the text should be stop at the end of the "writable" page.

What do you think ?

* Add a function CalculateHTMLTextOverflow as exists CalculateTextOverflow to calculate the text to write on other page ? (I guess HTML tags are a nithmare)

Both of your observations were correct. With paging on, the remainder continued at the top of the rectangle you passed on every new page, so a rectangle near the bottom gave you page after page with one or two lines; it now continues at the top of the next page's writable area, below the header. With paging off, nothing stopped the text at the bottom of the rectangle, so it ran into the footer; a line that starts below the rectangle is no longer drawn. Both are fixed for the next release. Note the second one is a behaviour change: if you have code that relies on HTML text overflowing its rectangle, it will now be clipped.

Happy to help you :+1: