How to avoid 'Printing' dialog when saving report to PDF

edited September 2016 in Devices
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

Comments

  • edited September 2016
    On 07/09/2016 09:18, Jonatan wrote:

    You need to call ppReport.PrintToDevices instead
  • edited September 2016
    Hi Jonatan,

    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
This discussion has been closed.