📣 We're Hiring!

Protecting a PDF file created with SuiteCRM

Hi everyone,

First of all, thanks for the amazing work with SuiteCRM. I am quite new with it, but I already love how powerful it is.

I am trying to input a password protection on the PDF’s generated through SuiteCRM, just to avoid other people to make any changes on it (allowed to print, but not to edit).
I believe I am very close to find a solution for this password function, but I lack on php knowledge to do it (I am actually a Marketing guy).

I found the following file on include/Sugarpdf/sugarpdf_default.php , made a copy of it on my custom folder and I am trying to add a custom password for the pdfs generated.

"PDF_PDF_VERSION"=>"1.7",
"PDF_PROTECTION"=>implode(",", array("print","copy")),
"PDF_USER_PASSWORD"=>"",
"PDF_OWNER_PASSWORD"=>"",
"PDF_ACL_ACCESS"=>"detail",

Anyone knows what I could change here to add a password on my pdfs?
Thanks a lot! :slight_smile:

Okay, I haven’t done this myself but here is a few places to look at.

Following a little of the Sugar docs (https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_10.0/Architecture/SugarPDF/#PDF_Settings) it seems you can create a new file in the custom folder that you can overwrite the sugarpdf settings.

./custom/include/Sugarpdf/sugarpdf_default.php

<?php

$sugarpdf_default["PDF_NEW_SETTING"] = "Value";

In this example I believe you want the user password right? So change PDF_NEW_SETTING to PDF_USER_PASSWORD

1 Like