Use a version that was released in this eon?
Switching to 2.1.7 shouldn't require much of a rewrite and will get you
onto a much more mature/stable code base. 5.0.6 is the Very Latest, but
involves a change in packages and license. AGPL. Do some research
before you decide to switch. It's important.
--Mark Storer
Senior Software Engineer
Cardiff.com
import legalese.Disclaimer;
Disclaimer<Cardiff> DisCard = null;
________________________________
From: Hari Ramakrishnan [mailto:[email protected]]
Sent: Tuesday, March 15, 2011 10:25 AM
To: Post all your questions about iText here
Subject: Re: [iText-questions] ClassCastException in
HTMLWorker.ParseToList
I am using iText 1.04. Is there any way to overcome this
problem?
Any idea would be greatly appreciated.
Thanks.
On Tue, Mar 15, 2011 at 12:00 PM, Nurettin DAG
<[email protected]> wrote:
This seems like a bug. What version of iText do you
experience this issue with?
On Tue, Mar 15, 2011 at 11:53 AM, Hari Ramakrishnan
<[email protected]> wrote:
Hi,
I am trying to generate a PDF using HTML
snippets which the user enters at runtime.
Sample HTML:
<table width=80%><tr><td><b><font size=+2><p
align="Center"> Highlight</b></font><br><p>some text<br><p><b><font
size=+1>Explanation </b></font><p>some text<p>some more text.<p>more and
more text<br><p> <img src = "http://localhost/images/bad.gif">
<br><p><b><font size=+1> Definition</b></font><br><p><table border=1><tr
align=center bgcolor="#CCCCCC"><td width=100><b> Code</b></td><td
width=400 align=center><b> Description</b></td><td width=100
align=center><b>text</b></td></tr><tr align=center><td
align=left>402.01</td><td align=left> failure</td><td
align=left>Other</td></tr><tr align=center><td align=left>402.11</td><td
align=left> failure</td><td align=left>Other</td></tr><tr
align=center><td align=left>402.91</td><td align=left> failure</td><td
align=left>Other</td></tr><tr align=center><td align=left>404.01</td><td
align=left> failure</td><td align=left>Other</td></tr><tr
align=center><td align=left>404.03</td><td align=left> failure</td><td
align=left>Other</td></tr><tr align=center><td align=left>404.11</td><td
align=left> failure</td><td align=left>Other</td></tr><tr
align=center><td align=left>404.13</td><td align=left> failure</td><td
align=left>Other</td></tr><tr align=center><td align=left>404.91</td><td
align=left> failure</td><td align=left>Other</td></tr><tr
align=center><td align=left>404.93</td><td align=left> failure</td><td
align=left>Other</td></tr><tr align=center><td align=left>428.0</td><td
align=left> unspecified</td><td align=left>Other</td></tr><tr
align=center><td align=left>428.1</td><td align=left> failure</td><td
align=left>Other</td></tr><tr align=center><td align=left>428.2</td><td
align=left> failure</td><td align=left>other</td></tr><tr
align=center><td align=left>428.20</td><td align=left> failure</td><td
align=left>other</td></tr><tr align=center><td align=left>428.21</td><td
align=left> failure</td><td align=left>other</td></tr><tr
align=center><td align=left>428.22</td><td align=left> failure</td><td
align=left>other</td></tr><tr align=center><td align=left>428.23</td><td
align=left> failure</td><td align=left>other</td></tr><tr
align=center><td align=left>428.3</td><td align=left> failure</td><td
align=left>other</td></tr><tr align=center><td align=left>428.30</td><td
align=left> failure</td><td align=left>other</td></tr><tr
align=center><td align=left>428.31</td><td align=left> failure</td><td
align=left>other</td></tr><tr align=center><td align=left>428.32</td><td
align=left> failure</td><td align=left>Other</td></tr><tr
align=center><td align=left>428.33</td><td align=left> failure</td><td
align=left>Other</td></tr><tr align=center><td align=left>428.4</td><td
align=left> failure</td><td align=left>Other</td></tr><tr
align=center><td align=left>428.40</td><td align=left> failure</td><td
align=left>Other</td></tr><tr align=center><td align=left>428.41</td><td
align=left> failure</td><td align=left>Other</td></tr><tr
align=center><td align=left>428.42</td><td align=left> failure</td><td
align=left>Other</td></tr><tr align=center><td align=left>428.43</td><td
align=left> failure</td><td align=left>Other</td></tr><tr
align=center><td align=left>428.9</td><td align=left>
unspecified</td><td
align=left>Other</td></tr></table><br><p><br><p><b><font size=+1>
Definition</b></font><p>Some more text.<p>More text.<p>more
text.<br><p><b><font size=+1>Appendix</b></font><br><p>In the Appendix
you will find useful information.<br><p><a href="http://server1
/Resource/17/pdf/Overview.pdf"><img src =
"http://localhost/images/bad.gif"></a>
Code used:
pdfCell.addElement((Element)HTMLWorker.parseToList(new
StringReader(strHtmlCode),null).get(0));
strHtmlCode contains the above HTML code
snippet.
The error from log file,
java.lang.ClassCastException:
com.lowagie.text.html.simpleparser.IncTable cannot be cast to
com.lowagie.text.Element
at
com.lowagie.text.html.simpleparser.HTMLWorker.endDocument(Unknown
Source)
at
com.lowagie.text.xml.simpleparser.SimpleXMLParser.go(Unknown Source)
at
com.lowagie.text.xml.simpleparser.SimpleXMLParser.parse(Unknown Source)
at
com.lowagie.text.html.simpleparser.HTMLWorker.parse(Unknown Source)
at
com.lowagie.text.html.simpleparser.HTMLWorker.parseToList(Unknown
Source)
at
com.lowagie.text.html.simpleparser.HTMLWorker.parseToList(Unknown
Source)
Please help me resolve this.
Thanks,
Hari
------------------------------------------------------------------------
------
Colocation vs. Managed Hosting
A question and answer guide to determining the
best fit
for your organization - today and in the future.
http://p.sf.net/sfu/internap-sfd2d
_______________________________________________
iText-questions mailing list
[email protected]
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
--
Nurettin DAG
------------------------------------------------------------------------
------
Colocation vs. Managed Hosting
A question and answer guide to determining the best fit
for your organization - today and in the future.
http://p.sf.net/sfu/internap-sfd2d
_______________________________________________
iText-questions mailing list
[email protected]
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
------------------------------------------------------------------------------
Colocation vs. Managed Hosting
A question and answer guide to determining the best fit
for your organization - today and in the future.
http://p.sf.net/sfu/internap-sfd2d
_______________________________________________
iText-questions mailing list
[email protected]
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