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.

Links Description
Pfizer Global Community User Guide (PDF)
 
Guide to using the tools available in the Pfizer Global Community - Discussion Forum, Feeds, Bookmarks, Files, Email Community, and the Pfizer L&K Wiki
 
Pfizer Global Community Lead Jump Start - Training Links A quick list of important links for Lotus Connections training materials and resources
Using Lotus Connections Guide A useful guide on how to work with the different tools within Lotus Connections
What to Use When Guide
 
Useful guide that maps Lotus Connection community tools to different types of information, so you know what tool to use to share your information and wins with your colleagues.
Video Series - Smarter Work with Social Networking
 
A series of short videos to help you understand how to leverage IBM's social networking capabilities and the Practitioner Portal to help you work faster, easier, and smarter.
Bulk Inviter Tool
 
Quickly add people to your network using the Bulk Inviter Tool.
How to Connect Your Smart Phone to Lotus Connections
 
Coming Soon....
 
Need Support? Contact Us - Ruth Fernandez If you have questions about how to work with the Pfizer Global Community, or Lotus Connections in general, send us an email or a chat on SameTime
 
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)

Attachment: help_111.pdf
Description: Binary data

Attachment: 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

Reply via email to