CoolUtils Logo
     

Convert PDF Files On Web Servers With Total PDF ConverterX

FREE DOWNLOAD
Buy Total PDF Converter X NOW!
(only $550.00)
Example C++:
#include <windows.h>

static const CLSID CLSID_PDFConverterX =
  {0x6B411E7E, 0x9503,0x4793,{0xA2, 0x87, 0x1F, 0x3B, 0xA8, 0x78, 0xB9, 0x1C}};
static const IID IID_IPDFConverterX =
  {0xEF633BED, 0xC414,0x49B0,{0x91, 0xFB, 0xC3, 0x9C, 0x3F, 0xE0, 0x08, 0x0D}};

#undef INTERFACE
#define INTERFACE IPDFConverterX
DECLARE_INTERFACE_(IPDFConverterX, IDispatch)
{
    STDMETHOD(QueryInterface)(THIS_ REFIID, PVOID*) PURE;
    STDMETHOD(Convert)(THIS_ LPCTSTR, LPCTSTR, LPCTSTR) PURE;
    STDMETHOD(About)(THIS) PURE;
    //const SourceFile: WideString; const DestFile: WideString; const Params: WideString; safecall;
};

typedef HRESULT (__stdcall *hDllGetClassObjectFunc) (REFCLSID, REFIID, void **);

int main () {
  HRESULT hr;
  if (CoInitialize(NULL)) {
    printf ("Error in CoInitialize.");
    return -1;
  }

  LPCTSTR lpFileName = "PDFConverter.dll";
  HMODULE hModule;
  hModule = LoadLibrary (lpFileName);
  printf ("hModule: %d\n", hModule);
  if (hModule == 0) {
    printf ("Error in LoadLibrary.");
    return -1;
  }

  hDllGetClassObjectFunc hDllGetClassObject = NULL;
  hDllGetClassObject = (hDllGetClassObjectFunc) GetProcAddress (hModule, "DllGetClassObject");
  if (hDllGetClassObject == 0) {
    printf ("Error in GetProcAddress.");
    return -1;
  }
  IClassFactory *pCF = NULL;
  hr = hDllGetClassObject (&CLSID_PDFConverterX, &IID_IClassFactory, (void **)&pCF);
  /* Can't load with different ID */
  printf ("hr hDllGetClassObject: %d\n", hr);
  if (!SUCCEEDED (hr)) {
    printf ("Error in hDllGetClassObject.");
    return -1;
  }
  IPDFConverterX *pIN;
  hr = pCF->lpVtbl->CreateInstance (pCF, 0, &IID_IPDFConverterX, (void **)&pIN);
  printf ("hr CreateInstance: %d\n", hr);
  if (!SUCCEEDED (hr)) {
    printf ("Error in hDllGetClassObject.");
    return -1;
  }
  hr = pCF->lpVtbl->Release (pCF);
  printf ("hr Release: %d\n", hr);
  if (!SUCCEEDED (hr)) {
    printf ("Error in Release.");
    return -1;
  }
  hr = pIN->lpVtbl->About (pIN);
  printf ("hr About: %d\n", hr);
  if (!SUCCEEDED (hr)) {
    printf ("Error in About.");
    return -1;
  }
  hr = pIN->lpVtbl->Convert (pIN, "test.pdf", "test.html","-cHTML");
  printf ("hr Convert: %d\n", hr);
  if (!SUCCEEDED (hr)) {
    printf ("Error in Convert.");
    return -1;
  }

  return 0;
}

If you need examples on other languages please contact us. We will create any example specially for you.

Note that ActiveX is 32-bit only. If you are trying to use activeX under 64-bit internet information server (IIS) activeX will not work. Use command line version instead (it works with both 32- and 64-bit servers).

More examples

Related topics

Convert PRN to BMP command line
Convert PRN to CSV command line
Convert PRN to PS command line
Convert PRN to EPS command line
Convert PRN to XHTML command line
Convert PRN to HTML command line
Convert PRN to DOC command line
Convert PRN to XLS command line
Convert PRN to JPEG command line
Convert PRN to TIFF command line
Convert PRN to RTF command line
Convert PDF to EPS command line
Convert PDF to BMP via Cmd like a Pro!
Convert PS to BMP with custom settings
Convert PS to DOC command line
Convert PDF to PS via Cmd like a Pro!
Convert PDF to RTF with custom settings
Convert PS to EPS command line
Convert PS to CSV with custom settings
Convert PDF to CSV any number of files in one go
Convert PS to RTF via GUI or Cmd fast
Convert files from PS to TIFF in 3 easy steps
Convert PS to XLS command line
Convert PS to JPEG command line
Convert PS to HTML command line
Get Server PDF Converter at an affordable price
Server PRN Converter converts PRN files on Windows Servers
Get Server PS Converter at an affordable price
Convert PS to XHTML command line
Convert PS to Unicode command line
Convert PS to Text command line
Convert PS to PNG command line
Convert PS to EMF command line
Convert PS to WMF command line
Convert PDF to EMF command line
Convert PDF to WMF command line
Convert PDF to PNG command line
Convert PDF to Text command line
Convert PRN to PNG command line
Convert PRN to Unicode Text command line
Convert PRN to EMF Text command line
Convert PRN to WMF command line
Convert PRN to Text command line
Convert PDF to JPEG command line
Convert PDF to DOC command line
Convert PDF to TIFF command line
Convert PDF to Excel command line

Back to Total PDF Converter X Home

Buy Total PDF Converter X NOW!
    FREE DOWNLOAD  
(only $550.00)
   Updated Thu, 30 Sep 2021
Total PDF Converter X Preview1


Site Map  |  Contacts |  Press Center | Resellers | About |  Privacy Policy |    Copyright © 1998-2021 CoolUtils Development. All rights reserved.