Page 1 of 1

Password Protect output document

Posted: Fri Jun 11, 2021 6:34 am
by azalea45
Greetings All,

It has a long while since doing any work with processmaker and our main processmaker developer has moved on to greener pastures. :(

There has been a legislative change that requires all documents with certain confidential information to be password protected.

The company made a decision that one of the fields on the dynaform will be used as the document password the password. In this case the field name is "IDNo".

All output documents are generated via a trigger.

I have seen that it is possible to password protect an output document but it has a standard password, e.g. "Password" but the password cannot change for each document recipient, e.g. recipient 1, with IDNo 123 will have document password 123, recipient 2, with IDNo 456 will have document password 456 .

Is it possible to do this and if so, can somebody provide some guidance or assistance?

I hope that this make sense.

Kind Regards,
Aza

Re: Password Protect output document

Posted: Wed Jun 23, 2021 5:54 am
by azalea45
Dear All,
As per my post above I have spend some time trying to find/implement a solution and came up with the following solution but I seem to be missing something. The documents are being generated but the security is not being applied.
Code: Select all
$docId = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx';

@=PDFSecurity = array (
'enabled' => 1,
'openPassword' => @@IdNo,
'ownerPassword' => 'password123',
'permissions' => 'print|copy',
);


PMFGenerateOutputDocument($docId,@@APPLICATION,null,null,@=PDFSecurity);
When I was looking at the PMFGenerateOutputDocument function in the wiki there are 4 variables that can be used however the proposed solution has 5. What do I need do so that the @=PDFSecurity array is applied when the document is created?

Thanks
Aza