I’m using Visual Developer 2010, MVC 3, c#. I’m trying to parse XML into an iTextSharp document like this:
ITextHandler textHandler = new ITextHandler(doc);
textHandler.Parse(xmldoc);
The error message says ITextHandler is not in this context. How can I make this work? Or is there another constructor that will do the same thing?
Here’s my list of using statements:
using System;
using System.IO;
using System.Text;
using System.Web;
using System.Web.Mvc;
using System.Xml;
using iTextSharp.text;
using iTextSharp.text.xml;
using iTextSharp.text.pdf;
Everything else seems to compile properly except for the ITextHandler line. Please help.
ITextHandler
is part of iText and iTextSharp 4.x series but was removed from the 5.x series in favor of iTextSharp.text.xml.simpleparser.SimpleXMLParser
. In recent months, however, another project has been gaining favor for XML and HTML parsing. Most, if not all XML and HTML work going forward is being done in the separate library xmlworker
found here. With in that library you'll find the iTextSharp.tool.xml.parser.XMLParser
class.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With