Logo

arrow2 File Converters

arrow2 Forensic

arrow2 TIFF and PDF apps

arrow2 Freeware

Total PDF Converter X

Convert PDF Files On Web Servers With Total PDF ConverterX

Example ASP:
dim C
Set C=CreateObject("PDFConverter.PDFConverterX")
C.Convert "c:\source.PDF", "c:\dest.HTML", "-cHTML -log c:\pdf.log"
set C = nothing
Example2 ASP: directly stream the resulting TIFF
dim C
Set C=CreateObject("PDFConverter.PDFConverterX")
Response.Clear
Response.AddHeader "Content-Type", "binary/octet-stream"
Rresponse.AddHeader "Content-Disposition", "attachment; filename=test.TIFF"
Response.BinaryWrite c.ConvertToStream("C:\www\ASP\Source.PDF", "C:\www\ASP", "-cTIFF  -log c:\PDF.log")
set C = nothing
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

Download

Examples of Total PDF ConverterX

Convert PDF files With TotalPDFConverterX and .NET

string src="C:\\test\\Source.PDF";
string dest="C:\\test\\Dest.TIFF";

PDFConverterX Cnv = new PDFConverterX();
Cnv.Convert(src, dest, "-c TIFF -log c:\\test\\PDF.log");

MessageBox.Show("Convert complete!");

Download .NET PDF Covnerter example

Convert PDF Files On Web Servers With Total PDF ConverterX

#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;
}

Convert PDF Files On Web Servers With Total PDF ConverterX

dim C
Set C=CreateObject("PDFConverter.PDFConverterX")
C.Convert "c:\source.PDF", "c:\dest.HTML", "-cHTML -log c:\pdf.log"
set C = nothing
Example2 ASP: directly stream the resulting TIFF
dim C
Set C=CreateObject("PDFConverter.PDFConverterX")
Response.Clear
Response.AddHeader "Content-Type", "binary/octet-stream"
Rresponse.AddHeader "Content-Disposition", "attachment; filename=test.TIFF"
Response.BinaryWrite c.ConvertToStream("C:\www\ASP\Source.PDF", "C:\www\ASP", "-cTIFF  -log c:\PDF.log")
set C = nothing

Convert PDF Files On Web Servers With Total PDF ConverterX

$src="C:\\test.pdf";
$dest="C:\\test.tiff";
if (file_exists($dest)) unlink($dest);
$c= new COM("PDFConverter.PDFConverterX");
$c->convert($src,$dest, "-c TIFF -log c:\doc.log");
if (file_exists($dest)) echo "OK"; else echo "fail:".$c->ErrorMessage;

Convert PDF Files With Total PDF ConverterX and Ruby

require 'win32ole'
c = WIN32OLE.new('PDFConverter.PDFConverterX')

src="C:\\test\\test.pdf";
dest="C:\\test\\test.tiff";

c.convert(src,dest, "-c TIFF -log c:\\test\\PDF.log");

if not File.exist?(dest)
  puts c.ErrorMessage
end

Convert PDF files With Total PDF ConverterX and Python

import win32com.client
import os.path

c = win32com.client.Dispatch("PDFConverter.PDFConverterX")

src="C:\\test\\test.pdf";
dest="C:\\test\\test.tiff";

c.convert(src, dest, "-c TIFF -log c:\\test\\PDF.log");

if not os.path.exists(file_path):
  print(c.ErrorMessage)

Convert PDF files With Pascal and Total PDF ConverterX

uses Dialogs, Vcl.OleAuto;

var
  c: OleVariant;
begin
  c:=CreateOleObject('PDFConverter.PDFConverterX');
  C.Convert('c:\test\source.pdf', 'c:\test\dest.tiff', '-c TIFF -log c:\test\PDF.log');
  IF c.ErrorMessage<> Then
    ShowMessage(c.ErrorMessage);
end;

Convert PDF Files On Web Servers With Total PDF ConverterX

var c = new ActiveXObject("PDFConverter.PDFConverterX");
c.Convert("C:\\test\\source.pdf", "C:\\test\\dest.tiff", "-c TIFF");
if (c.ErrorMessage!="")
  alert(c.ErrorMessage)

Convert PDF files With Total PDF ConverterX and Perl

use Win32::OLE;

my $src="C:\\test\\test.pdf";
my $dest="C:\\test\\test.tiff";

my $c = CreateObject Win32::OLE 'PDFConverter.PDFConverterX';
$c->convert($src,$dest, "-c TIFF  -log c:\\test\\PDF.log");
print $c->ErrorMessage if -e $dest;

More examples

Support
Get all CoolUtils products
for $99 only
read more

  (you save up to $500)


Total PDF Converter X Preview1

Coolutils.com

Latest News

  • In the new Total PDF Converter , the conversion from xps\oxps to docx was significantly improved.
  • Online converter now supports Biological Formats spe; nd2; pds; lsm; sif; fpf; vff; nmr; zvi; dm3; isac; afm; ser; mri.
  • New Total Excel Converter adds the ability to Export hidden sheets.
  • New Total Image Converter has improved working with Open Office images (.fh7 - 11).
  • After the update, our converters use a new data encryption standard: AES 128 and 256 bits.
  • The updated Total PDF Converter has improved / accelerated work with large files of 10,000 or more pages.

Newsletter Subscribe

No worries, we don't spam.


© 2020. All rights reserved. CoolUtils File Converters

Cards