Forum


Replies: 3   Views: 213
Setting pdf document security settings
Topic closed:
Please note this is an old forum thread. Information in this post may be out-to-date and/or erroneous.
Every phpdocx version includes new features and improvements. Previously unsupported features may have been added to newer releases, or past issues may have been corrected.
We encourage you to download the current phpdocx version and check the Documentation available.

Posted by meyerandassoc  · 31-05-2024 - 11:25

Hi,

A company that we send PDFs to cannot process them through their automated system due to two Document Property -> Security settings.

Their system is having issues with 'Filling of Form Fields' and 'Signing' being set to 'Allowed'. They need these settings to be 'Not Allowed'.

Is there any way to set/modify these settings when saving a PDF?

 

Thanks in advance,

James

Posted by admin  · 31-05-2024 - 11:52

Hello,

The conversion plugin doesn't include options to change those security settings when generating a PDF.

Premium licenses include a CryptoAPI module to encrypt and protect DOCX, PDF, XLSX and PPTX files. For example, you can use protectPDF (https://www.phpdocx.com/api-documentation/cryptophpdocx/protect-pdf-document-with-PHP) to handle PDF security settings:

$pdf->protectPDF($source, $target, array('permissionsBlocked' => array('print', 'modify', 'copy', 'annot-forms', 'fill-forms', 'extract', 'assemble', 'print-high')));

Regards.

Posted by meyerandassoc  · 31-05-2024 - 12:10

Thank you for this information. 

Looking at the list of settings that can be blocked in your documentation, the 'Signing' setting is not included. Is there a way to block 'Signing'?

 

Thanks,

James

Posted by admin  · 31-05-2024 - 12:31

Hello,

Using the following options:

$pdf->protectPDF($source, $target, array('permissionsBlocked' => array('modify', 'annot-forms', 'fill-forms')));

the "signing" permission is also blocked. The sample from our previous reply blocks all available settings (including "signing").

Regards.