Active9 years ago
I tried with itext and could not get xml format i want to convert pdf to xml i just want text(location,size) which is available in XML format and so any one help ne. Convert Office-Documents to PDF without interop. Rate this: Please Sign up or sign in to vote. See more: C#. Hi, is it possible to convert Word-Documents (*.doc, *.xls, *.vsd.) to PDF or TIF, JPEG. Without Office? Wes Aday,itextsharp is a good free source for PDF task, but can it convert doc to image? Rate this: Please Sign.
Okay... I'm trying to use the most recent version of ITextSharp to turn an XML file into a PDF. It isn't working.
The documentation on SourceForge doesn't seem to have kept up with the actual releases; the code in the provided example won't even compile under the newest version.
Here is my test XML:
And here is the code I'm attempting to use to turn that into a PDF.
Now, I was pretty sure the
(ISimpleXMLDocHandler)doc
piece wasn't going to work, but I can't actually find anything in the source that both a) implements ISimleXMLDocHandler and b) will accept a standard XML document and parse it to PDF.FYI- I did try an older version which would compile using the example code from sourceforge, but it wasn't working either.
AllenGAllenG
![Itextsharp Itextsharp](https://i.ytimg.com/vi/8aEUe9oHVIs/hqdefault.jpg)
2 Answers
After browsing the 5.0.2 code, it looks like there is no document that will just take XML and turn it into a PDF for you. So, unless you can find similar code on the web or in an old release of iTextSharp, you'll need to write it yourself.
John FisherJohn Fisher19.4k22 gold badges3232 silver badges5959 bronze badges
iText XML to PDF requires that the XML be formatted according to itext.dtd (please Google responsibly). You can also use a tagmap.xml to map your XML entities to those appropriate according to the DTD.
Convert Pdf To Xml File
Peter HendricksonPeter Hendrickson