<< Click to Display Table of Contents >> Navigation: Create a PDF Editor > Delphi Example > Add "Form.Create" |
The event FormCreate is used to initialize the application and load the PDF files passed as command line.
Here we also call the function which initializes the toolbar.
procedure TForm2.FormCreate(Sender: TObject);
var i : Integer;
s : String;
begin
InitToolbar;
// Do some initialisation
PageControl1.Align := alClient;
WPViewPDF1.Visible := false;
// Open all documents from command line
for i := 1 to ParamCount do
begin
s := ParamStr(i);
if (CompareText(ExtractFileExt(s), '.pdf') = 0) and (FileExists(s)) then
begin
NewPDFDocument(s);
end;
end;
end;
When we start the application it should look like this: