Hi,

I get the error when the following code is executed:
XMLWorkerHelper.GetInstance().ParseXHtml(writer, pdfDoc, new
StringReader(contents));

The value of contents variable in the above code is in the attachment.

Search for the text "Demo CM - sales achievement<" in the attachment. The
error occurred when I added the < symbol to the text. When it was just
"Demo CM - sales achievement", the pdf generated properly.

The itext and xmlworker versions are 5.4.3.

kindly reply.

Thanks,
Vani.





On Tue, Sep 24, 2013 at 6:25 PM, Michael Demey
<michael.de...@itextpdf.com>wrote:

> Hi,
>
> Please provide the HTML that is failing and the iText and XmlWorker
> version numbers. If the versions are not the most recent ones (5.4.4)
> please upgrade and try again.
>
> Without those, we can only guess. And going from the error message my
> guess would be:
>
> "Your HTML is invalid."
>
> Kind regards,
> Michaƫl.
>
>
> Op 24/09/2013 13:51, Vani Bose schreef:
> > Hi,
> > We use iTextSharp tool to generate pdf from html. We get an error if we
> > enter < symbol in a text box and the html is converted to pdf.
> > *Invalid nested tag tr found, expected closing tag td. at
> > iTextSharp.tool.xml.XMLWorker.EndElement(String tag, String ns) at
> > iTextSharp.tool.xml.parser.XMLParser.EndElement() at
> > iTextSharp.tool.xml.parser.state.ClosingTagState.Process(Char character)
> > at iTextSharp.tool.xml.parser.XMLParser.ParseWithReader(TextReader
> > reader) at iTextSharp.tool.xml.parser.XMLParser.Parse(TextReader reader)
> > at iTextSharp.tool.xml.XMLWorkerHelper.ParseXHtml*
> > How can this be fixed?
> > Thanks,
> > Vani.
> >
> >
> >
> ------------------------------------------------------------------------------
> > October Webinars: Code for Performance
> > Free Intel webinars can help you accelerate application performance.
> > Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most
> from
> > the latest Intel processors and coprocessors. See abstracts and register
> >
> >
> http://pubads.g.doubleclick.net/gampad/clk?id=60133471&iu=/4140/ostg.clktrk
> >
> >
> >
> > _______________________________________________
> > 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
> >
>
>
>
> ------------------------------------------------------------------------------
> October Webinars: Code for Performance
> Free Intel webinars can help you accelerate application performance.
> Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most
> from
> the latest Intel processors and coprocessors. See abstracts and register >
> http://pubads.g.doubleclick.net/gampad/clk?id=60133471&iu=/4140/ostg.clktrk
> _______________________________________________
> 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
>
<!DOCTYPE html><html xmlns='http://www.w3.org/1999/xhtml'><head>    
<title></title></head><body>    <div style='text-align: center; width: 650px;'> 
       <h2>Plan Cycle Summary</h2>    </div>    <table cellspacing='0' 
cellpadding='5' border='1' style='border: 2px solid black; width: 650px; 
font-size: 13px'>        <tbody>            <tr style='vertical-align: top'>    
            <td style='background-color: #A8A49F; width: 220px; height: 50px;'> 
                   <b>Plan Cycle</b>                </td>                <td 
style='width: 400px'>DEMO-CM Annual 1, 2013                </td>            
</tr>            <tr style='vertical-align: top'>                <td 
style='background-color: #A8A49F; width: 220px; height: 50px;'>                 
   <b>Status</b>                </td>                <td>Pending Plan Cycle 
submission                </td>            </tr>        </tbody>    </table>    
<div style='height: 20px'></div>    <table cellspacing='0' cellpadding='5' 
border='1' style='border: 2px solid black; width: 650px; font-size: 13px;'>     
   <tbody>            <tr style='vertical-align: top'>                <td 
style='background-color: #A8A49F; width: 220px; height: 50px;'>                 
   <b>Period</b>                </td>                <td style='width: 
400px'>Currently in Week 39 of Annual 1                </td>            </tr>   
         <tr style='vertical-align: top'>                <td 
style='background-color: #A8A49F; width: 220px; height: 50px;'>                 
   <b>Last Action By</b>                </td>                <td>Christian Ager 
on 24-Sep-2013 6:53 PM                </td>            </tr>        </tbody>    
</table>    <div style='height: 20px'></div>    <table cellspacing='0' 
cellpadding='5' border='1' style='border: 2px solid black; width: 650px; 
font-size: 13px;'>        <tbody>                            <tr 
style='vertical-align: top'>                    <td style='background-color: 
#A8A49F; width: 220px; height: 100px;'>                        <b>How Sales 
achievement will be measured</b>                    </td>                    
<td style='width: 400px;'>Demo CM - sales achievement<                    </td> 
               </tr>                                            <tr 
style='vertical-align: top'>                    <td style='background-color: 
#A8A49F; width: 220px; height: 100px;'>                        <b>How Strategic 
Objectives will be measured</b>                    </td>                    
<td>Demo CM - strategic objectives                    </td>                
</tr>                            <tr style='vertical-align: top'>               
     <td style='background-color: #A8A49F; width: 220px; height: 100px;'>       
                 <b>Additional Information or Rules</b>                    
</td>                    <td style='width: 400px'>Demo CM - Additional info     
               </td>                </tr>        </tbody>    
</table></body></html>
------------------------------------------------------------------------------
October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from 
the latest Intel processors and coprocessors. See abstracts and register >
http://pubads.g.doubleclick.net/gampad/clk?id=60133471&iu=/4140/ostg.clktrk
_______________________________________________
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