Skip to content

How to convert format of a file to other format

praveen pandey

Asked Oct 24, 2006, 5:42 AM EDT4 answers
Share
LinkedInX
hi everybody,
how can format of file be converted to other format through c# code?
eg. xml to doc,htm,pdf
     doc to xml,htm,pdf
     pdf to xml,htm,doc
     htm to xml,pdf,doc
  
 any help would be appreciated.
thanks in advance.

                praveen pandey

4 Answers

Know the answer? Post it. Somebody with the same question will find it here.

  • 0
    There is no such functionality in any programming language. For each particular task there must be a specifically coded object library (made by MS or a 3rd party) that you can use to make a particular conversion. You can convert a doc file to text using Microsoft Office library, etc.
     
    Besides the question itself is very vague: an XML file IS already a text file, and technically you can make any text file to be an XML, just surround it with <somename></somename>.
    0
  • rebecca yang
    0
    You can use third party dll from E-iceblue,sure it supports what i have mentioned above .
    0
  • 0
    That is quite a requirement you got there, well regarding the DOC, HTM and PDF formats you could check out the following links:
    But for an XML file I'm not sure what kind a conversion you would like to achieve, would you like to create a table that will contain XML data or just plain XML content written inside a documents. Also what kind of XML are you expecting to get from Word or PDF documents?
    0
  • 0
    PDF format are not natively supported by Microsoft and you might need to use a 3rd party library to handle PDF and Doc files. Doc files are covered by additional Microsoft libraries like Microsoft Office Document Imaging MODI. For PDFs, there are many options such as itextsharp, lead tools and Haru. Some of them offer standard load/save support and some provide advanced PDF capabilities. However, I'm not sure about html formats if they are natively supported or not but I think they are.
    0