Click here to Skip to main content
15,849,829 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hello guys

i have following code

C#
ArrayList htmlelement = HTMLWorker.ParseToList(new StringReader(content), null);
      foreach (ArrayList htmlElement in htmlelement)
           Document.Add(htmlElement as IElement);



in this content is html file
having some text and 1 table.

the foreeach added all text
but when he read the table it give the following error

C#
Unable to cast object of type 'iTextSharp.text.pdf.PdfPTable' to type 'System.Collections.ArrayList'.


thank you
@ChetanV@
Posted
Updated 3-Apr-12 1:14am
v2

C#
var htmlelement = HTMLWorker.ParseToList(new StringReader(content), null);
       foreach (var htmlElement in htmlelement)
            Document.Add(htmlElement as IElement);
 
Share this answer
 
v2
As the error suggests, the types are incorrect.
PdfPTable cannot be converted to an ArrayList.

You might need to check the iTextSharp documentation for help.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900