Java Mailing List Archive

http://www.junlu.com/

Home » Home (12/2007) » iText »

[iText-questions] Document/PdfPTable problem from v1.0 <

Jani Bäckman

2005-01-21


I have just been thrown into a new project where final release is on Monday and my part is to implement a Kerning-method for an itext application. The person who has made the application has gone to Malaysia so she can't be reached...

In itext1.0 the API lacks BaseFont.setKerning and therefor I've upgraded to 1.1. This is where the troble started...

For some reason my code stops at one single line where I ad a PdfPTable on a Document ( document.addTable( table ); ) due to StackOverflowError.

I've not done any coding at all yet because I needed the Kerning before I could begin. Has somebody else come across this problem?

If I change to 1.0 everything works just fine. I've tried 1.2 and the same thing occurs...

StackTrace:

Caused by: java.lang.StackOverflowError
        at com.lowagie.text.pdf.PdfWriter$PdfBody$PdfCrossReference.compareTo(PdfWriter.java:189)
        at java.util.TreeMap.compare(TreeMap.java:1085)
        at java.util.TreeMap.put(TreeMap.java:463)
        at java.util.TreeSet.add(TreeSet.java:209)
        at com.lowagie.text.pdf.PdfWriter$PdfBody.getIndirectReferenceNumber(PdfWriter.java:307)
        at com.lowagie.text.pdf.PdfWriter$PdfBody.getPdfIndirectReference(PdfWriter.java:302)
        at com.lowagie.text.pdf.PdfWriter.addSimple(PdfWriter.java:1437)
        at com.lowagie.text.pdf.PdfContentByte.setFontAndSize(PdfContentByte.java:1097)
        at com.lowagie.text.pdf.PdfDocument.writeLineToContent(PdfDocument.java:2602)
        at com.lowagie.text.pdf.ColumnText.go(ColumnText.java:794)
        at com.lowagie.text.pdf.ColumnText.go(ColumnText.java:706)
        at com.lowagie.text.pdf.PdfPRow.writeCells(PdfPRow.java:329)
        at com.lowagie.text.pdf.PdfPTable.writeSelectedRows(PdfPTable.java:482)
        at com.lowagie.text.pdf.PdfPTable.writeSelectedRows(PdfPTable.java:558)
        at com.lowagie.text.pdf.PdfPTable.writeSelectedRows(PdfPTable.java:514)
        at com.lowagie.text.pdf.ColumnText.goComposite(ColumnText.java:1307)
        at com.lowagie.text.pdf.ColumnText.go(ColumnText.java:718)
        at com.lowagie.text.pdf.ColumnText.go(ColumnText.java:706)
        at com.lowagie.text.pdf.PdfDocument.addPTable(PdfDocument.java:958)
        at com.lowagie.text.pdf.PdfDocument.add(PdfDocument.java:1667)
        at com.lowagie.text.Document.add(Document.java:276)
        at com.polopoly.ad.maker.generator.PdfGenerator$MyTableEvent.checkPages(PdfGenerator.java:581) <-- document.addTable( table ); 
        at com.polopoly.ad.maker.generator.PdfGenerator$MyTableEvent.tableLayout(PdfGenerator.java:497)

/Jani

©2008 junlu.com - Jax Systems, LLC, U.S.A.