How to avoid 'Printing' dialog when saving report to PDF
Hi!
I have code:
ppReport.Device:=dvFile;
ppReport.DeviceType:='PDF';
ppReport.TextFileName:='D:\Work\ZZZ.pdf';
ppReport.ShowPrintDialog:=False;
ppReport.ModalCancelDialog:=True;
ppReport.ModalPreview:=True;
ppReport.Print;
This code is saving report to PDF but while it is doing so, it shows
'Printing' dialog which is unnecessary for background job. How to avoid
this dialog. I don't need this dialog even for the half of seconds.
Jonatan
I have code:
ppReport.Device:=dvFile;
ppReport.DeviceType:='PDF';
ppReport.TextFileName:='D:\Work\ZZZ.pdf';
ppReport.ShowPrintDialog:=False;
ppReport.ModalCancelDialog:=True;
ppReport.ModalPreview:=True;
ppReport.Print;
This code is saving report to PDF but while it is doing so, it shows
'Printing' dialog which is unnecessary for background job. How to avoid
this dialog. I don't need this dialog even for the half of seconds.
Jonatan
This discussion has been closed.
Comments
You need to call ppReport.PrintToDevices instead
Here's a simple example:
uses
ppTypes;
myReport.DeviceType := dtPDF;
myReport.TextFileName := 'c:\myReport.pdf';
myReport.ShowPrintDialog := False; // suppress print dialog
myReport.ShowCancelDialog := False; // suppress cancel dialog
myReport.Print;
More details here..
http://www.digital-metaphors.com/rbWiki/Output/PDF/PDF_Fundamentals
Best regards,
-
Nard Moseley
Digital Metaphors
www.digital-metaphors.com
Best regards,
Nard Moseley
Digital Metaphors
www.digital-metaphors.com