The
title refers to the thread started by Francois Gravel in 2002 when he
found that a multi-line paragraph would "run over" the page. To remedy
that a fix was inserted in PdfDocument.java at around line 1213. In
trying to get HTMLWorker happy with Images in Paragraphs, I've set up
the Images in a series of one-line Paragraphs. In order iText to not
overrun the Image at either the top or bottom of a page, the leading
for the Paragraph is set to the greater of the image height or the
existing leading. However, this approach runs afoul of the fix above,
which I believe presumes that there will be another line in the same
Paragraph after the carriageReturn() call. In my case, that fix
essentially adds the line height and leading together with the current
position on the page to determine whether a newPage() call is
warranted, which can lead to large amounts of whitespace when a picture
is followed by a caption. As far as I can see, that is only correct if
the current line is not the
last line of the paragraph. If the current lines is the last line, then
there should be no need to use the leading in this test because the
leading itself is not applied in the call.

I seek the collective
knowledge of the list in determining whether my analysis is correct and
if so, how this can be repaired. I may be misusing the Paragraph
leading but I saw no other way to set the "height" of my
Image-containing Paragraph.

Thanks,
Steve
------------------------------------------------------------------------------
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions

Buy the iText book: http://www.1t3xt.com/docs/book.php

Reply via email to