How to convert PDF to XML in C#

VeryDOC PDF to XML Converter SDK is the best choice to convert PDF to XML in C#, as well as conversion from PDF to text and PDF to image.

Features of VeryPDF PDF to XML Converter SDK

  • DLL and COM Interface can be called in any program languages
  • Support 2000/XP/Vista/7, both 32bit and 64bit, Windows platforms
  • Support integrating SDK functions into your own applications
  • Support converting PDF files to XML files, PDF files to image files and PDF files to text files
  • Support owner password and user password protected PDF files’ processes
  • Support image resolution/color depth setting in DPI
  • Always multithread safe
  • Able to be used for further data analysis

If features of this SDK tool raise your interest to try it, please feel free to download trial version of VeryDOC PDF to XML Converter here. And for more information about how to convert PDF file to XML/text/image in C#, just read the following example:

private void button1_Click(object sender, EventArgs e)

        {

            string appPath = Path.GetDirectoryName(Application.ExecutablePath);

            string strInPDFFile;

            string strOutFile;

            long nRet;

            strInPDFFile = (appPath + "\\example.pdf");

            strOutFile = (appPath + "\\example.xml");

            VeryPDF2XMLSetLicenseCode("XXXXXXXXXXXXXXXXXXX");

            string szOptions = "-res 150 -bitcount 24 -outimg \"";

            szOptions += appPath + "\\outimage-%04d.jpg";

            szOptions += "\"";

            nRet = VeryPDF2XMLConverter(strInPDFFile, strOutFile, szOptions);

            nRet = VeryPDF2XMLConverter(strInPDFFile, appPath + "\\outtxt.txt", "-txt");

            nRet = VeryPDF2XMLConverter(strInPDFFile, strOutFile, "");

        }

And based on the example above, some tips are as follows:

  • The following is to create image file with resolution 150, bit count 24            string szOptions = "-res 150 -bitcount 24 -outimg \"";
    szOptions += appPath + "\\outimage-%04d.jpg";
    szOptions += "\"";
    nRet = VeryPDF2XMLConverter(strInPDFFile, strOutFile, szOptions);
  • The following is to produce text file

nRet = VeryPDF2XMLConverter(strInPDFFile, appPath + "\\outtxt.txt", "-txt");

  • The following is to generate XML file

nRet = VeryPDF2XMLConverter(strInPDFFile, strOutFile, "");

By here, this article nearly come to the end. If you encounter questions during converting PDF file to text/image/XML with developer license of VeryDOC PDF to XML Converter SDK, as well as integrating functions into other applications, just let us know as soon as possible. And in the end, I hope you can enjoy this SDK tool. 🙂

VN:F [1.9.20_1166]
Rating: 0.0/10 (0 votes cast)
VN:F [1.9.20_1166]
Rating: 0 (from 0 votes)

Related Posts

Leave a Reply

Your email address will not be published. Required fields are marked *


Verify Code   If you cannot see the CheckCode image,please refresh the page again!