Home Devices
New Blog Posts: Merging Reports - Part 1 and Part 2

PDF Password

edited September 2013 in Devices
Hi,

I use ReportBuilder 14.04 with Delphi XE2.

I created a report for sending PDF encrypted file by group change
(create new file and email new file).

I set a PDFSettings.EncryptSettings.UserPassword on Event
OnGetFileSuffix, because I set the password with the recipient email
(with a datapipeline information).

I received correctly a email and PDF file but, the password for the
first PDF included in email is not set.

How set PDF password correctly with a datapipeline information for the
first sending email?

Best regards.

Marius Céré

Comments

  • edited September 2013
    Hi Marius,

    The OnGetFileSuffix event fires too late to alter the first password.
    By this time the report is already generating.

    One solution would be to update the initial password before the report
    prints, then re-update it in the OnGetFileSuffix or OnGetEmailSettings
    event as you already ar.

    Another solution would be to use the FileDevice.OnStartJob event to
    update the TppPDFDevice.PDFSettings.EncryptSettings.UserPassword
    property as needed.

    uses
    ppSMTPIndy10,
    ppPDFDevice;

    procedure TForm1.ppReport1FileDeviceCreate(Sender: TObject);
    begin
    ppReport1.FileDevice.OnStartJob := ehFileDevice_StartJob;

    end;

    procedure TForm1.ehFileDevice_StartJob(aSender: TObject);
    begin
    TppPDFDevice(ppReport1.FileDevice).PDFSettings.EncryptSettings.UserPassword
    := ;

    end;

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
This discussion has been closed.