function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
FORCE ITSSRCFORCE ITSSRC 

Password Protection For Attachment

Hi All,

How to put password protection for pdf in atttachment.

Thanks,
Surya
NagendraNagendra (Salesforce Developers) 
Hi Force,

As far as I know, you can't password-protect a PDF generated by the system itself (through Visualforce's renderAs page attribute). That means you'll have to rely upon the security set up in your organization.

Please refer below thread for more information on that.

https://developer.salesforce.com/forums/?id=906F0000000914vIAA

But you will be able to limit who can see your visualforce page by only adding specific profiles to the page.
  1. From Setup, enter Visualforce Pages in the Quick Find box, then select Visualforce Pages.
  2. Next to the name of the page that you want to restrict, click Security.
  3. Select the profiles that you want to enable from the Available Profiles list and click Add.
  4. Select the profiles that you want to disable from the Enabled Profiles list and click Remove.
  5. Click Save.

https://help.salesforce.com/apex/HTViewHelpDoc?id=pages_security_page_def.htm&language=en_US

Please mark this post as best answer if it helps you.

Best Regards,
Nagendra.P
sophian smithssophian smiths
You will have to to provide the Protect PDF Application Tool the protect password when the a PDF which is password protected. It is not possible to merge/edit the PDF document without password. You will have to use the PDF Document object for providing the password. The Append method also will take the PDF Document object as a parameter. Below is for this link:- https://www.osttopstapp.com/protect-pdf.html