#1 2019-12-20 10:48:44

berndl666
Member
Registered: 2019-12-20
Posts: 2

Create protected PDF

Hi,

I am trying to generate a password protected PDF that cannot be modified w/o password like so:

lPdf := TPdfDocumentGDI.Create(false, 0 , false, TPDFEncryption.New(elRC4_128, '', 'password', PDF_PERMISSION_NOMODIF));

When I open the PDF in LibreOffice Draw I am prompted for the password, but may click Cancel or enter a blank password and the PDF is still opened and can be modified.
What am I doing wrong?

Thanks!

Offline

#2 2019-12-20 11:15:24

berndl666
Member
Registered: 2019-12-20
Posts: 2

Re: Create protected PDF

There is one further issue when using the Encryption:

As soon as I create a protected PDF with

lPdf := TPdfDocumentGDI.Create(false, 0 , false, TPDFEncryption.New(elRC4_128, '', 'password', PDF_PERMISSION_NOMODIF));

the data entered in the document´s TPDFInfo like

lPDF.Info.Author := 'Auto Generated Document';
lPDF.Info.Creator := 'XYZ GmbH';

can no longer be displayed properly in Adobe Acrobat or any other PDF reader.

Did anyone successfully use TPDFEncryption without this issues?

Offline

#3 2020-01-21 07:39:51

kalwados
Member
Registered: 2011-04-18
Posts: 15

Re: Create protected PDF

We are facing the very same problem:

Creating a protected PDF makes the information fields (Title, Author, Creator, Subject) unreadable when opening the PDF in Adobe Reader (or any other PDF viewer like Foxit Reader, even Google Chrome).

This used to work in past versions (can't tell which one; but I think this bug was introduced lately).

I've created an issue ticket on Github:
https://github.com/synopse/SynPDF/issues/32

Hopefully @ab will fix this as soon as possible.

Many thanks in advanve,
Achim

Offline

Board footer

Powered by FluxBB