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

EncryptSettings

edited December 2015 in General
I use RB 15.03 Build 87, Delphi XE5:

I tried the following simple example:

procedure TForm4.Button1Click(Sender: TObject);
begin
ppReport1.AllowPrintToFile := True;
ppReport1.ShowPrintDialog := False;
ppReport1.DeviceType := dtPDF;

ppReport1.PDFSettings.Author := 'ReportBuilder';
ppReport1.PDFSettings.Title := 'Export to PDF Demo';
ppReport1.PDFSettings.Creator := 'Creator';
ppReport1.PDFSettings.Subject := 'Subject';
ppReport1.PDFSettings.PDFA := True;
ppReport1.PDFSettings.ScaleImages := True;

ppReport1.PDFSettings.EncryptSettings.KeyLength := kl128bit;
ppReport1.PDFSettings.EncryptSettings.AllowCopy := False;
ppReport1.PDFSettings.EncryptSettings.AllowInteract := False;
ppReport1.PDFSettings.EncryptSettings.AllowModify := False;
ppReport1.PDFSettings.EncryptSettings.AllowPrint := False;
ppReport1.PDFSettings.EncryptSettings.OwnerPassword := 'Owner';
ppReport1.PDFSettings.EncryptSettings.UserPassword := 'User';

ppReport1.PDFSettings.OpenPDFFile := False;

ppReport1.TextFileName := 'C:\tmp\MyPDFFile.pdf';
ppReport1.PDFSettings.EncryptSettings.Enabled := True;

ppReport1.Print;
end;

The Output PDF ist not encrypted.
Where is my mistake?

Best regards, Olaf

Comments

  • edited December 2015
    For PDFA - EncryptSettings disabled. (procedure TppPDFDevice.StartJob)


  • edited December 2015
    http://www.pdfa.org/2011/06/pdfa-faq/

    Encryption is not permitted in PDF/A files. If, for example, a file
    requires a password to open it, then either a person who knows the
    password or a digital key must be available. The content of a PDF/A file
    must however always be accessible, which is why encryption is not
    allowed. A possible way to protect sensitive data in a PDF/A file is to
    put access constraints on the storage medium where the file is located
    (e.g. password access to the folder).

This discussion has been closed.