Hi, We have requirement to convert HTML to PDF in our application. We are facing a problem in case HTML has empty rows(<tr></tr>) in a table. While converting, it is throwing IndexOutofBoundsException. If empty rows are removed then table is not shown in the pdf.
Please find below more details about versions and other information which will help understand the problem. 1. We are using itext PDF 5.1.3 and XML worker 1.1.1. Tried with latest versions(5.4.0) of both the jars but still problem exists. 2. HTML is created by users on a different product and hence we don't have any control over it. It only checks if HTML is valid. 3. The HTML causing the problem is 4. Exception stack trace is 5. Output PDF when empty rows are removed is 6. Code Please help resolve the problem. Thanks & Regards Naveen D.R. ----------------------------------------------------------- Global Business Solutions Centre IBM India Private Ltd. #12, Subramanya Arcade Block 2, Bannerghatta Road Bangalore - 560029 Phone: 41954473 Email: dr.nav...@in.ibm.com
Return to Wiki Home |
Welcome to the Lotus Connections Resource Center, where you can find how-tos and training information on how to work with Lotus Connections.
|
Index: -1, Size: 0 java.lang.IndexOutOfBoundsException: Index: -1, Size: 0 at java.util.ArrayList.get(ArrayList.java:352) at com.itextpdf.tool.xml.html.table.Table.widenLastCell(Table.java:520) at com.itextpdf.tool.xml.html.table.Table.end(Table.java:168) at com.itextpdf.tool.xml.html.AbstractTagProcessor.endElement(AbstractTagProcessor.java:189) at com.itextpdf.tool.xml.pipeline.html.HtmlPipeline.close(HtmlPipeline.java:206) at com.itextpdf.tool.xml.XMLWorker.endElement(XMLWorker.java:141) at com.itextpdf.tool.xml.parser.XMLParser.endElement(XMLParser.java:395) at com.itextpdf.tool.xml.parser.state.ClosingTagState.process(ClosingTagState.java:70) at com.itextpdf.tool.xml.parser.XMLParser.parseWithReader(XMLParser.java:235) at com.itextpdf.tool.xml.parser.XMLParser.parse(XMLParser.java:213) at com.itextpdf.tool.xml.parser.XMLParser.parse(XMLParser.java:202) at com.itextpdf.tool.xml.XMLWorkerHelper.parseXHtml(XMLWorkerHelper.java:221) at com.itextpdf.tool.xml.XMLWorkerHelper.parseXHtml(XMLWorkerHelper.java:235) at com.itextpdf.tool.xml.XMLWorkerHelper.parseXHtml(XMLWorkerHelper.java:196) at com.test.TestExportPDF.main(TestExportPDF.java:42)
help_111.pdf
Description: Binary data
TestExportPDF.java
Description: Binary data
------------------------------------------------------------------------------ Symantec Endpoint Protection 12 positioned as A LEADER in The Forrester Wave(TM): Endpoint Security, Q1 2013 and "remains a good choice" in the endpoint security space. For insight on selecting the right partner to tackle endpoint security challenges, access the full report. http://p.sf.net/sfu/symantec-dev2dev
_______________________________________________ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions iText(R) is a registered trademark of 1T3XT BVBA. Many questions posted to this list can (and will) be answered with a reference to the iText book: http://www.itextpdf.com/book/ Please check the keywords list before you ask for examples: http://itextpdf.com/themes/keywords.php