PDF Creator Pilot documentation |
Download CHM version of this manual. |
|
![]() ![]() Collapse AllFirst of all you need to 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 TPDFDocument3 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: TPDFDocument3;
in the "var" section.
}
uses
PDFCreatorPilotLib_TLB
{...}
var
PDF: TPDFDocument3;
{...}
procedure TForm1.Button1Click(Sender: TObject);
begin
PDF := TPDFDocument3.Create(nil);
{...}
end;
Visual Basic or Visual Basic Script : Set PDF = CreateObject("PDFCreatorPilot.PDFDocument3")
C/C++ : IPDFDocument3* PDF = NULL;
CLSID clsid;
HRESULT hr = CLSIDFromProgID(OLESTR("PDFCreatorPilot.PDFDocument3"), &clsid);
if(hr != S_OK)
{
// can't load. no such COM installed.
return;
}
hr = CoCreateInstance(clsid, 0, CLSCTX_ALL, __uuidof(IPDFDocument3), (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.PDFDocument3Class PDF = new PDFCreatorPilotLib.PDFDocument3Class(); This step makes the run-time library active and creates a new object: PDF document. 2. You must start the PDF engine using the StartEngine method and optional correct license parameters, if you have one. Delphi : PDF.StartEngine 'demo@demo', 'demo' Visual Basic or Visual Basic Script : PDF.StartEngine "demo@demo", "demo" C/C++ : PDF->StartEngine("demo@demo", "demo");
C# : PDF.StartEngine("demo@demo", "demo");
3. The next step is to set up PDF document parameters, like file name, creation date, title, and so forth. Delphi : PDF.DocumentInfo_CreationDate := StrToDateTime('28.05.2008 10:02');
PDF.Filename := 'c:\demo.pdf';
PDF.DocumentInfo_Title := 'PDF Creator Pilot Demo';
PDF.AutoLaunch := true;
PDF.Compression := ctFlate;
Visual Basic or Visual Basic Script : PDF.DocumentInfo_CreationDate = Now PDF.Filename = "c:\demo.pdf" PDF.DocumentInfo_Title = "PDF Creator Pilot Demo" PDF.AutoLaunch = True PDF.Compression = 1 C/C++ : PDF->DocumentInfo_CreationDate = COleDateTime::GetCurrentTime().m_dt; PDF.Filename = "c:\\demo.pdf"; PDF.DocumentInfo_Title = "PDF Creator Pilot Demo"; PDF.AutoLaunch = TRUE; PDF.Compression = ctFlate; C# : PDF.DocumentInfo_CreationDate = DateTime.Now; PDF.Filename = @"c:\demo.pdf"; PDF.DocumentInfo_Title = "PDF Creator Pilot Demo"; PDF.AutoLaunch = true; PDF.Compression = TxCompressionType.ctFlate; See descriptions of the following "document-dependent" methods: AutoLaunch, DocumentInfo_Title, FileName, FontEmbedStyle, ProtectionEnabled. 4. Run BeginDoc to start working with the PDF object. Delphi : PDF.BeginDoc; Visual Basic or Visual Basic Script : PDF.BeginDoc C/C++ : PDF->BeginDoc(); C# : PDF.BeginDoc(); 5. Complete the action you want in the PDF workplace: write text, draw objects, create new pages. See all method groups for a full description: General methods, Draw methods, Outlines, Annotations. 6. Finalize your work with EndDoc. This makes a real PDF file, if you don't use GenerateInMemoryFile. Delphi : PDF.EndDoc; Visual Basic or Visual Basic Script : PDF.EndDoc C/C++ : PDF->EndDoc(); C# : PDF.EndDoc();
|








See Also