I'm trying to track down an issue that has come up using
JasperReports to render PDFs on Mac OS X (Java SE 1.5). My current
best guess is that the issue lies with
com.lowagie.text.pdf.PdfGraphics2D.drawString, but then again it
could be a Mac OS X bug or some other system...
In summary, the PDF generation in JasperReports goes into an infinite
loop, causing a StackOverflowExcpeption. It looks to me as if the
cause could be com.lowagie.text.pdf.PdfGraphics2D.drawString
(PdfGraphics2D.java:334).
To reproduce the problem, grab a copy of JasperReports, run the ant
script for the samples and you'll see the problem on the Barbecue
example. I've made some comments here: https://sourceforge.net/forum/
forum.php?thread_id=1390859&forum_id=113530
I've tried this out using the a itext.jar build from CVS source, and
the problem still exists. I took a look at the source for
PdfGraphics2D, but I'm afraid to say I've not got very far with it.
All I've done is add a couple of dumb debug outputs...
if (onlyShapes) {
TextLayout tl = new TextLayout(s, this.font, new
FontRenderContext(new AffineTransform(), false, true));
System.out.println("ABOUT TO DRAW");
tl.draw(this, x, y);
System.out.println("DRAW DONE");
}
...and what I see is a lot of ABOUT TO DRAW, then a stack overflow
without a DRAW DONE output.
I'm hoping this might make the issue obvious to someone? Or at least
rule out iText as being the source of this issue.
Many thanks
Richard
--
Partial stack trace:
sun.font.SunLayoutEngine.nativeLayout(Native Method)
sun.font.SunLayoutEngine.layout(SunLayoutEngine.java:130)
sun.font.GlyphLayout$EngineRecord.layout(GlyphLayout.java:571)
sun.font.GlyphLayout.layout(GlyphLayout.java:392)
sun.font.ExtendedTextSourceLabel.createGV
(ExtendedTextSourceLabel.java:299)
sun.font.ExtendedTextSourceLabel.getGV(ExtendedTextSourceLabel.java:
284)
sun.font.ExtendedTextSourceLabel.createLogicalBounds
(ExtendedTextSourceLabel.java:173)
sun.font.ExtendedTextSourceLabel.getAdvance
(ExtendedTextSourceLabel.java:87)
java.awt.font.TextLine.init(TextLine.java:245)
java.awt.font.TextLine.<init>(TextLine.java:99)
java.awt.font.TextLine.fastCreateTextLine(TextLine.java:740)
java.awt.font.TextLayout.fastInit(TextLayout.java:695)
java.awt.font.TextLayout.<init>(TextLayout.java:480)
com.lowagie.text.pdf.PdfGraphics2D.drawString(PdfGraphics2D.java:342)
sun.font.ExtendedTextSourceLabel.handleDraw
(ExtendedTextSourceLabel.java:135)
sun.font.Decoration.drawTextAndDecorations(Decoration.java:99)
sun.font.ExtendedTextSourceLabel.draw(ExtendedTextSourceLabel.java:140)
java.awt.font.TextLine.draw(TextLine.java:550)
java.awt.font.TextLayout.draw(TextLayout.java:2699)
com.lowagie.text.pdf.PdfGraphics2D.drawString(PdfGraphics2D.java:344)
sun.font.ExtendedTextSourceLabel.handleDraw
(ExtendedTextSourceLabel.java:135)
sun.font.Decoration.drawTextAndDecorations(Decoration.java:99)
sun.font.ExtendedTextSourceLabel.draw(ExtendedTextSourceLabel.java:140)
java.awt.font.TextLine.draw(TextLine.java:550)
java.awt.font.TextLayout.draw(TextLayout.java:2699)
com.lowagie.text.pdf.PdfGraphics2D.drawString(PdfGraphics2D.java:344)
sun.font.ExtendedTextSourceLabel.handleDraw
(ExtendedTextSourceLabel.java:135)
sun.font.Decoration.drawTextAndDecorations(Decoration.java:99)
sun.font.ExtendedTextSourceLabel.draw(ExtendedTextSourceLabel.java:140)
java.awt.font.TextLine.draw(TextLine.java:550)
java.awt.font.TextLayout.draw(TextLayout.java:2699)
com.lowagie.text.pdf.PdfGraphics2D.drawString(PdfGraphics2D.java:344)
sun.font.ExtendedTextSourceLabel.handleDraw
(ExtendedTextSourceLabel.java:135)
sun.font.Decoration.drawTextAndDecorations(Decoration.java:99)
sun.font.ExtendedTextSourceLabel.draw(ExtendedTextSourceLabel.java:140)
java.awt.font.TextLine.draw(TextLine.java:550)
java.awt.font.TextLayout.draw(TextLayout.java:2699)
com.lowagie.text.pdf.PdfGraphics2D.drawString(PdfGraphics2D.java:344)
sun.font.ExtendedTextSourceLabel.handleDraw
(ExtendedTextSourceLabel.java:135)
sun.font.Decoration.drawTextAndDecorations(Decoration.java:99)
sun.font.ExtendedTextSourceLabel.draw(ExtendedTextSourceLabel.java:140)
java.awt.font.TextLine.draw(TextLine.java:550)
java.awt.font.TextLayout.draw(TextLayout.java:2699)
com.lowagie.text.pdf.PdfGraphics2D.drawString(PdfGraphics2D.java:344)
sun.font.ExtendedTextSourceLabel.handleDraw
(ExtendedTextSourceLabel.java:135)
sun.font.Decoration.drawTextAndDecorations(Decoration.java:99)
sun.font.ExtendedTextSourceLabel.draw(ExtendedTextSourceLabel.java:140)
java.awt.font.TextLine.draw(TextLine.java:550)
java.awt.font.TextLayout.draw(TextLayout.java:2699)
com.lowagie.text.pdf.PdfGraphics2D.drawString(PdfGraphics2D.java:344)
sun.font.ExtendedTextSourceLabel.handleDraw
(ExtendedTextSourceLabel.java:135)
sun.font.Decoration.drawTextAndDecorations(Decoration.java:99)
sun.font.ExtendedTextSourceLabel.draw(ExtendedTextSourceLabel.java:140)
java.awt.font.TextLine.draw(TextLine.java:550)
java.awt.font.TextLayout.draw(TextLayout.java:2699)
com.lowagie.text.pdf.PdfGraphics2D.drawString(PdfGraphics2D.java:344)
sun.font.ExtendedTextSourceLabel.handleDraw
(ExtendedTextSourceLabel.java:135)
sun.font.Decoration.drawTextAndDecorations(Decoration.java:99)
sun.font.ExtendedTextSourceLabel.draw(ExtendedTextSourceLabel.java:140)
java.awt.font.TextLine.draw(TextLine.java:550)
java.awt.font.TextLayout.draw(TextLayout.java:2699)
com.lowagie.text.pdf.PdfGraphics2D.drawString(PdfGraphics2D.java:344)
sun.font.ExtendedTextSourceLabel.handleDraw
(ExtendedTextSourceLabel.java:135)
sun.font.Decoration.drawTextAndDecorations(Decoration.java:99)
sun.font.ExtendedTextSourceLabel.draw(ExtendedTextSourceLabel.java:140)
java.awt.font.TextLine.draw(TextLine.java:550)
java.awt.font.TextLayout.draw(TextLayout.java:2699)
com.lowagie.text.pdf.PdfGraphics2D.drawString(PdfGraphics2D.java:344)
sun.font.ExtendedTextSourceLabel.handleDraw
(ExtendedTextSourceLabel.java:135)
sun.font.Decoration.drawTextAndDecorations(Decoration.java:99)
sun.font.ExtendedTextSourceLabel.draw(ExtendedTextSourceLabel.java:140)
java.awt.font.TextLine.draw(TextLine.java:550)
java.awt.font.TextLayout.draw(TextLayout.java:2699)
com.lowagie.text.pdf.PdfGraphics2D.drawString(PdfGraphics2D.java:344)
-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems? Stop! Download the new AJAX search engine that makes
searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions