PDF Creator Pilot documentation |
Download CHM version of this manual. |
|
![]() ![]() Collapse AllFirst add PDF Creator Pilot library to you project. For Delphi:
For Microsoft Visual Studio (C++):
For Microsoft Visual Studio (.NET):
Each session with PDF documents contains the following steps: 1. Your programming language must initialize the PDF Creator Pilot run-time library, as follows. Delphi : Just drag a component TPDFDocument4 from your ActiveX panel to a form. { 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.
}
uses
PDFCreatorPilotLib_TLB, ...
{...}
var
PDF: TPDFDocument4;
{...}
procedure TForm1.Button1Click(Sender: TObject);
begin
PDF := TPDFDocument4.Create(nil);
{...}
end;
Visual Basic or Visual Basic Script : Set PDF = CreateObject("PDFCreatorPilot.PDFDocument4")
C/C++ : 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;
}
C# : /* PDFCreatorPilot must be added to project as reference (in the COM tab page). */ PDFCreatorPilotLib.PDFDocument4Class PDF = new PDFCreatorPilotLib.PDFDocument4Class(); This step makes the run-time library active and creates a new object: PDF document. 2. You must start the PDF engine using the SetLicenseData method and optional correct license parameters, if you have one. Delphi : PDF.SetLicenseData('demo@demo', 'demo');
Visual Basic or Visual Basic Script : PDF.SetLicenseData "demo@demo", "demo" C/C++ : PDF->SetLicenseData("demo@demo", "demo");
C# : PDF.SetLicenseData("demo@demo", "demo");
3. The next step is to set up PDF document parameters, like title, and so forth. Delphi : PDF.SetTitle('PDF Creator Pilot Demo', fcANSI);
PDF.ProducePDFA := false;
PDF.Compression := coFlate;
Visual Basic or Visual Basic Script : PDF.SetTitle "PDF Creator Pilot Demo", 1 'FontCharset.fcANSI PDF.ProducePDFA = False PDF.Compression = 1 'coFlate C/C++ : PDF->SetTitle("PDF Creator Pilot Demo", fcANSI);
PDF->ProducePDFA = false;
PDF->Compression = coFlate;
C# : PDF.SetTitle("PDF Creator Pilot Demo", FontCharset.fcANSI);
PDF.ProducePDFA = false;
PDF.Compression = CompressionType.coFlate;
See descriptions of the following "document-dependent" methods: Title, Compression, ProducePDFA. 4. Complete the action you want in the PDF workplace: write text, draw objects, create new pages. See all method groups for a full description of IPDFDocument4. 5. Finalize your work with SaveToFile or GetBuffer methods. Delphi : PDF.SaveToFile('test.pdf', dfalse);
Visual Basic or Visual Basic Script : PDF.SaveToFile "test.pdf", false C/C++ : PDF->SaveToFile("test.pdf", false);
C# : PDF.SaveToFile("test.pdf", false);
|








See Also