45
Code Examples
6
6
©2012 CoolUtils by Softplicity
4
Code Examples
Below are some code examples (for ActiveX, ASP, and PHP) on how to call Total PDF ConverterX
from your own applications.
Note You can find the ready-to-use Visual Studio C# solutions in Total PDF ConverterX's
installation folder.
ASP
dim C
Set C=CreateObject("PDFConverter.PDFConverterX")
C.Convert "c:\source.PDF", "c:\dest.HTML", "-cHTML -log c:\pdf.log"
set C = nothing
ASP (Direct streaming of the resulting PDF file)
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
PHP
$src="C:\test.PDF";
$dest="C:\test.XLS";
if (file_exists($dest)) unlink($dest);
$c= new COM("PDFConverter.PDFConverterX");
$c->convert($src,$dest, "-c XLS -log c:\pdf.log");
if (file_exists($dest)) echo "OK"; else echo "fail:".$c->ErrorMessage;
C++
#include
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; S
TDMETHOD(Convert)(THIS_ LPCTSTR, LPCTSTR, LPCTSTR) PURE;
STDMETHOD(About)(THIS) PURE;
//const SourceFile: WideString; const DestFile: WideString; const Params: