There is no problem in exporting to encrypted PDF. But the password entered when opening the PDF is incorrect.
ppReport_201709_PDF.DeviceType:='PDF'; with ppReport_201709_PDF.PDFSettings do begin Author:='test'; Title:='test'; end; with ppReport_201709_PDF.PDFSettings.EncryptSettings do begin Enabled:=True; UserPassword := 'test'; end; ppReport_201709_PDF.TextFileName:='test.PDF'; ppReport_201709_PDF.Print;
Since there is no example of encrypted PDF in the demo provided, can it be provided as a reference?
Thanks for the information. In my tests, encryption is working correctly with code similar to yours and I am able to successfully open a password protected PDF. Below is the code I used to test. If you are still unable to get this working, please create a simple example and send it to support@digital-metaphors.com and I'll take a look at what is happening.
Thanks for the example and information. This issue appears to only occur when the Windows regional locale is set to a non-latin value. It likely has to do with the changed ANSI code page being used in that case.
We will research this further and report back here once a solution is found.
Comments
Which version of ReportBuilder and Delphi are you using? ReportBuilder has supported encrypted PDF exports for quite some time.
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
There is no problem in exporting to encrypted PDF.
But the password entered when opening the PDF is incorrect.
ppReport_201709_PDF.DeviceType:='PDF';
with ppReport_201709_PDF.PDFSettings do begin
Author:='test';
Title:='test';
end;
with ppReport_201709_PDF.PDFSettings.EncryptSettings do begin
Enabled:=True;
UserPassword := 'test';
end;
ppReport_201709_PDF.TextFileName:='test.PDF';
ppReport_201709_PDF.Print;
Since there is no example of encrypted PDF in the demo provided, can it be provided as a reference?
Thanks for the information. In my tests, encryption is working correctly with code similar to yours and I am able to successfully open a password protected PDF. Below is the code I used to test. If you are still unable to get this working, please create a simple example and send it to support@digital-metaphors.com and I'll take a look at what is happening.
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
The project file has been sent to support@digital-metaphors.com
Exported PDF cannot be opened by correct password.
Delphi 10.4.1 & RB 20.04
Delphi 10.4 & RB 18.01
Delphi XE & RB 20.04
Thanks for the example and information. This issue appears to only occur when the Windows regional locale is set to a non-latin value. It likely has to do with the changed ANSI code page being used in that case.
We will research this further and report back here once a solution is found.
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Note that this issue only affects certain regional locales.
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com