BeginDoc

Top  Previous  Next

This procedure initializes the PDF export.

 

If you are using the WPPDFExport component it is not necessary to use this procedure unless you need to execute 'Print' several times to export into one PDF file.

 

WPPDFExport1.PageCount := WPPDFExport1.Source.CountPages*10;

WPPDFExport1.BeginDoc;

for i:=1 to 10 do

   WPPDFExport1.Print;

WPPDFExport1.EndDoc;

WPPDFExport1.PageCount := 0;        

 

 

You can check if a PDFFrinter has already started a file by checking the property 'Printing'. In this case you should not call BeginDoc and EndDoc if you want to create a combined PDF file.

 

To implement a "Start/Stop" button  you can use this code:

 

procedure TForm1.StartStopPDFClick(Sender: TObject);

begin

 WPPDFPrinter1.Printing := not WPPDFPrinter1.Printing;

end;

 

Please note that if you are rendering different reports into the same PDF file the filename used by the different report engines (ReportBuilder, RAVE ...) is ignored.