VeryPDF PDF to Any Converter SDK is a Royalty Free DLL Library for Developers, which can convert from PDF files to Word, Excel, PowerPoint, HTML, XML, PostScript, EPS, plain text and image, like TIFF, JPEG, TGA, PNG, GIF, BMP, and PNM (PPM, PBM, and PPM) etc. formats

VeryPDF PDF to Any Converter SDK is a DLL Library for developers, if you wish convert from PDF files to Word, Excel, PowerPoint, HTML, XML, PostScript, EPS, plain text and image, like TIFF, JPEG, TGA, PNG, GIF, BMP, and PNM (PPM, PBM, and PPM) etc. formats, VeryPDF PDF to Any Converter SDK will be your best choice.

The trial version of VeryPDF PDF to Any Converter SDK can be downloaded from this web page,

http://www.verypdf.com/app/pdf-to-any-converter/try-and-buy.html#buy-sdk
http://www.verypdf.com/dl2.php/pdf2anysdk.zip

image

This is a simple C++ source code to call the PDF to Any Converter SDK,

#include <windows.h>

#include <stdio.h>

#include <string>

#include <vector>

using namespace std;

 

void GetModulePath(char *lpOutPath, char *lpInFileName)

{

         char drive[_MAX_DRIVE];

         char dir[_MAX_DIR];

         char fname[_MAX_PATH];

         char ext[_MAX_EXT];

 

         GetModuleFileName(NULL, lpOutPath, 256);

         _splitpath(lpOutPath, drive, dir, fname, ext );

         _makepath(lpOutPath, drive, dir, lpInFileName, "");

}

 

typedef  int (__stdcall *VeryPDFPDF2AnyConverterFunc)(const char *lpszCmdLine);

typedef void (__stdcall *VeryPDFPDF2AnySetCodeFunc)(const char *lpRegcode);

VeryPDFPDF2AnyConverterFunc lpVeryPDFPDF2AnyConverter = NULL;

VeryPDFPDF2AnySetCodeFunc   lpVeryPDFPDF2AnySetCode = NULL;

BOOL PDF2AnyConverterSDK(const char *lpszLicenseKey, const char *lpszCmdLine)

{

         if(lpszCmdLine == NULL || lpszCmdLine[0] == 0)

                   return FALSE;

 

         char szPath[_MAX_PATH];

         GetModulePath(szPath,"pdf2anysdk.dll");

         HINSTANCE hPDF2AnySDK = LoadLibrary(szPath);

         if(hPDF2AnySDK == NULL)

                   return FALSE;

        

         lpVeryPDFPDF2AnyConverter = (VeryPDFPDF2AnyConverterFunc)
                GetProcAddress(hPDF2AnySDK,
"VeryPDFPDF2AnyConverter");

         if(lpVeryPDFPDF2AnyConverter == NULL)

                   return FALSE;

        

         lpVeryPDFPDF2AnySetCode =(VeryPDFPDF2AnySetCodeFunc)
                GetProcAddress(hPDF2AnySDK,
"VeryPDFPDF2AnySetCode");

         if(lpVeryPDFPDF2AnySetCode ==NULL)

                   return FALSE;

        

         if(lpszLicenseKey && lpszLicenseKey[0] != 0)

                   lpVeryPDFPDF2AnySetCode(lpszLicenseKey);

         int nResult = lpVeryPDFPDF2AnyConverter(lpszCmdLine);

         FreeLibrary(hPDF2AnySDK);

         return nResult;

}

 

 

std::wstring strtowstr(const std::string str)

{

    // Convert an ASCII string to a Unicode String

    int nLength = str.length()*2+1;

    std::wstring wstrTo;

    wchar_t *wszTo = new wchar_t[nLength];

    memset(wszTo, 0, sizeof(wchar_t)*nLength);

    MultiByteToWideChar(CP_ACP, 0, str.c_str(), -1, wszTo, (int)nLength);

    wstrTo = wszTo;

    delete[] wszTo;

    return wstrTo;

}

 

int main(int argc, char* argv[])

{

         if(argc == 1)

         {

                   printf("Usage: [options] <in-file> [<out-file>]\n");

                   return 0;

         }

         string strLicenseKey;

         char szCmdBuf[2048] = {0};

         for(int i = 1; i < argc; i++)

         {

                   if(stricmp(argv[i], "-$") == 0)

                   {

                            strLicenseKey = argv[i+1];

                            i++;

                   }

                   else

                   {

                            strcat(szCmdBuf, "\"");

                            strcat(szCmdBuf, argv[i]);

                            strcat(szCmdBuf, "\" ");

                   }

         }

 

         int nRet = 0;

         nRet = PDF2AnyConverterSDK(strLicenseKey.c_str(), szCmdBuf);

         printf("nRet = %d\n",nRet);

         return nRet;

}

int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,

         LPTSTR lpCmdLine, int nCmdShow)

{

         return main(__argc,__argv);

}

 

This is a simple C# source code to call the PDF to Any Converter SDK,

 

using System;

using System.Collections.Generic;

using System.ComponentModel;

using System.Data;

using System.Drawing;

using System.Linq;

using System.Text;

using System.Windows.Forms;

using VeryPDF;

using System.IO;

 

namespace WindowsFormsApplication1

{

    public partial class Form1 : Form

    {

        public Form1()

        {

            InitializeComponent();

        }

 

        private void button1_Click(object sender, EventArgs e)

        {

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

            string strPDFFile = appPath + "\\test.pdf";

            string strOutFile = appPath + "\\_test_out.tif";

            string strLicenseKey = "XXXX-XXXX-XXXX-XXXX";

 

            string strCmd = "\"" + strPDFFile + "\" \"" + strOutFile + "\"";

 

            System.Type VeryPDFType = System.Type.GetTypeFromProgID("VeryPDF.PDFtoAnyCom");

            VeryPDF.PDFtoAnyCom VeryPDFCom = (VeryPDF.PDFtoAnyCom)
                 System.
Activator.CreateInstance(VeryPDFType);

            int nReturn = VeryPDFCom.PDFtoAny(strLicenseKey, strCmd);

            MessageBox.Show("Converter finished.");

        }

    }

}

 

You can integrate PDF to Any Converter SDK into your application easily, you can convert PDF to 20+ formats with just a few code lines.

 

If you encounter any problem with PDF to Any Converter SDK, please feel free to let us know, we will assist you asap.

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

This entry was posted in VeryPDF SDK & COM and tagged , , , , , , , , , . Bookmark the permalink.

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!