PDF Creator Pilot documentation |
Download CHM version of this manual. |
|
![]() ![]() Collapse AllIPDFDocument4 interface categories:
|
| interface IPDFDocument4 |
Example
How to Use the IPDFDocument4 Interface
Delphi
[copy to clipboard]
{ Select menu Project -> Import Type Library
Find "PDFCreatorPilot Type Library (Version 1.0)".
Import this type library.
Add PDFCreatorPilotLib_TLB in the "uses" section.
Add line:
PDF: TPDFDocument4;
in the "var" section.
}
PDF := TPDFDocument4.Create(nil);
PDF.SetLicenseData('demo@demo', 'demo');
{ now PDF object is ready to use }
{ something else goes here... }
PDF.SaveToFile('c:\test.pdf', false);
PDF.Destroy;
C/C++
[copy to clipboard]
/*
PDFCreatorPilot must be installed in the system.
(regsvr32 PDFCreatorPilot.dll)
*/
IPDFDocument4* PDF = NULL;
CLSID clsid;
HRESULT hr = CLSIDFromProgID(OLESTR("PDFCreatorPilot.PDFDocument4"), &clsid);
if(hr != S_OK)
{
// can't load. no such COM installed.
return;
}
hr = CoCreateInstance(clsid, 0, CLSCTX_ALL, __uuidof(IPDFDocument4), (LPVOID *)&PDF);
if(hr != S_OK)
{
// can't load. no such COM installed.
return;
}
PDF->SetLicenseData("demo@demo", "demo");
// now PDF object is ready to use
// something else goes here...
PDF->SaveToFile("c:\\test.pdf", false);
PDF->Release();
PDF = NULL;
C#
[copy to clipboard]
/*
PDFCreatorPilot must be added to project as reference
(in the COM tab page).
*/
PDFCreatorPilotLib.PDFDocument4Class pdf = new PDFCreatorPilotLib.PDFDocument4Class();
pdf.SetLicenseData("demo@demo", "demo");
// now PDF object is ready to use
// something else goes here...
pdf.SaveToFile(@"c:\test.pdf", false);
pdf = null;
Visual Basic
[copy to clipboard]
' PDFCreatorPilot must be installed in the system.
' (regsvr32 PDFCreatorPilot.dll)
Set PDF = CreateObject("PDFCreatorPilot.PDFDocument4")
PDF.SetLicenseData "demo@demo", "demo"
' now PDF object is ready to use
' something else goes here...
PDF.SaveToFile "c:\test.pdf", False
Set PDF = nothing
See Also
Reference


