Problem: If a Document begins with chunks or Chunk.NEWLINE, the newlines will not be printed, the chunks will be overprinted.
<<Test examples.java>>
Patch:
The reason of that behaviour is that in line 423 of
* $Id: PdfDocument.java,v 1.174 2004/02/07 10:28:40
blowagie Exp $
leading is initiated with 0.
A quick solution is to insert after line 1192
case Element.CHUNK: {
the following line:
leading = ((Chunk) element).font().leading(1.5f);
(The more beautiful solution, to initiate leading with
Float.NaN and do the setting here conditionally, does
not work, (at least not so quick) because the
carriageReturn(); in line 2077 of initPage(), which is
called by open(), will try to insert a
PdfLine with the height Float.NaN and I don't know,
whether there are more side effects.)
With kind regards
Klaus Fleischer
newline.java
Description: Test examples.java
