Sigh ... I've changed the version of iText (as you suggested) but i get the same error. Should I try using older versions of iText?!?
On 12 Mar, 17:51, "jOpenDocument, Guillaume" <[email protected]> wrote: > Hi, > > You found a bug in iText 5.01 ! > > I recommend you to use iText 2.1.7, which is the last LGPL version of iText, > before the switch to AGPL. > > We will update the tutorial. > > Regards, > Guillaume > ILM Informatique > > > Hi folks, > > > I've tried to run the example "Create a PDF document from a > > spreadsheet" reported on this > > page:http://www.jopendocument.org/tutorial_pdf.html > > > But I got a corrupted PDF file and the following errors on console > > (even using the file invoice.ods that i downloaded by templates used > > in the tutorials in the section "Download" > > (http://www.jopendocument.org/downloads.html > > ). > > > -------------- JAVA CONSOLE -------- > > Dump attributes: > > 'table:name' -> 'Invoice' > > 'table:style-name' -> 'ta1' > > 'table:print-ranges' -> 'Invoice.A1:Invoice.J50' > > content.xml : ignoring :office:forms > > Not StyleDefaultStyle:urn:oasis:names:tc:opendocument:xmlns:datastyle: > > 1.0 > > Not StyleDefaultStyle:urn:oasis:names:tc:opendocument:xmlns:datastyle: > > 1.0 > > Not StyleDefaultStyle:urn:oasis:names:tc:opendocument:xmlns:datastyle: > > 1.0 > > Not StyleDefaultStyle:urn:oasis:names:tc:opendocument:xmlns:datastyle: > > 1.0 > > Not StyleDefaultStyle:urn:oasis:names:tc:opendocument:xmlns:style:1.0 > > Not StyleDefaultStyle:urn:oasis:names:tc:opendocument:xmlns:style:1.0 > > StylePageLayoutProperties: Assuming Page Format A4: Width: 21.0cm > > StylePageLayoutProperties: Assuming Page Format A4: Height: 29.7cm > > inizio...... > > in mezzo...... > > Assuming default font:Arial > > Assuming default font:Arial > > Assuming default font:Arial > > Assuming default font:Arial > > Assuming default font:Arial > > Assuming default font:Arial > > Assuming default font:Arial > > Assuming default font:Arial > > Assuming default font:Arial > > Assuming default font:Arial > > Exception in thread "Main Thread" > > com.itextpdf.text.exceptions.IllegalPdfSyntaxException: Unbalanced > > save/restore state operators. > > at > > com.itextpdf.text.pdf.PdfContentByte.sanityCheck(PdfContentByte.java: > > 3172) > > at com.itextpdf.text.pdf.PdfContentByte.toPdf(PdfContentByte.java: > > 245) > > at com.itextpdf.text.pdf.PdfFormXObject.<init>(PdfFormXObject.java: > > 88) > > at com.itextpdf.text.pdf.PdfTemplate.getFormXObject(PdfTemplate.java: > > 241) > > at > > com.itextpdf.text.pdf.PdfWriter.addSharedObjectsToBody(PdfWriter.java: > > 1254) > > at com.itextpdf.text.pdf.PdfWriter.close(PdfWriter.java:1169) > > at com.itextpdf.text.pdf.PdfDocument.close(PdfDocument.java:780) > > at com.itextpdf.text.Document.close(Document.java:409) > > at com.itextpdf.text.pdf.PdfDocument.close(PdfDocument.java:770) > > at com.itextpdf.text.Document.close(Document.java:409) > > at Test.main(Test.java:77) > > > ----------------------------------------------------------------------------------------------------- > > > Is this a bug? Did developers omit some lines of code in this example? > > I used > > - jOpenDocument1.2b2 > > - iText 5.0.1 > > - Java 6
