Hi,
HTMLWorker is deprecated, please use XMLWorker: http://sourceforge.net/projects/itextsharp/files/xmlworker/ Kind regards, Michaƫl. Op 22/08/2013 12:45, Qaisar Shabbir Awan schreef: > I have tried below code i am also facing the error, so please help me to > solve this error. > > Thanks. I am using latest dll. > > publicvoidconvertToPDF() > > { > > Documentdocument = newDocument(); > > try > > { > > //writer - have our own path!!! > > PdfWriter.GetInstance(document, newFileStream(@"E:\Traning > Projects\ConvertDocFileToPDF\HTML-to-PDF.pdf", FileMode.OpenOrCreate)); > > document.Open(); > > strSelectUserListBuilder = "<table border='0' > width='600' cellspacing='0' cellpadding='0'>"+ > > "<tr>"+ > > "<td>"+ > > "<p align='center'><img border='0' > src='/images/ResumeBottomBorderBrown.jpg' width='600' height='10'><br>"+ > > "<font face='Arial' size='3' color='#876E3A'><b>Consultants<br></b></font>"+ > > "<img border='0' src='images/ResumeBottomBorderBrown.jpg' width='600' > height='10'>"+ > > "</td>"+ > > "</tr>"+ > > " <tr><td>"+ > > "</td></tr>"+ > > // FOOTER > > "<tr>"+ > > "<td>"+ > > "<p align='center'><img border='0' > src='images/ResumeBottomBorderBrown.jpg' width='600' height='10'>"+ > > "</td>"+ > > "</tr>"+ > > "</table>"+ > > "<br><br><br>"; > > //Here is where your HTML source goes................ > > StringhtmlText = strSelectUserListBuilder.ToString(); > > //make an arraylist ....with STRINGREADER since its no IO reading file... > > List<IElement> htmlarraylist = > iTextSharp.text.html.simpleparser.HTMLWorker.ParseToList(newStringReader(htmlText), > null); > > //add the collection to the document > > for(intk = 0; k < htmlarraylist.Count; k++) > > { > > IElementx = (IElement)htmlarraylist[k]; > > // document.Add((IElement)htmlarraylist[k]); > > } > > //document.Add(new Paragraph("And the same with indentation....")); > > // or add the collection to an paragraph > > // if you add it to an existing non emtpy paragraph it will insert it from > > //the point youwrite - > > Paragraphmypara = newParagraph();//make an emtphy paragraph as "holder" > > mypara.IndentationLeft = 36; > > mypara.InsertRange(0, htmlarraylist); > > document.Add(mypara); > > } > > catch(Exceptionexx) > > { > > //Console.Error.WriteLine(exx.StackTrace); > > //Console.Error.WriteLine(exx.StackTrace); > > } > > finally > > { > > document.Close(); > > } > > } > > *I got this error:* "The given key was not present in the dictionary." > > Kindly help me. Thanks > > Best Regards, > > ** > > *Qaisar Shabbir Awan *| PowerObjects | 2^nd Floor, 68W ASMA Plaza, > Jinnah Avenue, Blue Area| Islamabad 44000 > Office: +92 51-280-3305**| Mobile: +92 333-564-1988 | Email: > _qaisar.awan@powerobjects.com_ > > > > ------------------------------------------------------------------------------ > Introducing Performance Central, a new site from SourceForge and > AppDynamics. Performance Central is your source for news, insights, > analysis and resources for efficient Application Performance Management. > Visit us today! > http://pubads.g.doubleclick.net/gampad/clk?id=48897511&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 > ------------------------------------------------------------------------------ Introducing Performance Central, a new site from SourceForge and AppDynamics. Performance Central is your source for news, insights, analysis and resources for efficient Application Performance Management. Visit us today! http://pubads.g.doubleclick.net/gampad/clk?id=48897511&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