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
PRASANTH S 12PRASANTH S 12 

send the password protection pdf via salesforce apex email to customer

when i am trying to create one email to send the pdf to the customer 
but, the customer ask I need a password pdf when I am clicking pdf will be ask password and open it .....any clue?
PriyaPriya (Salesforce Developers) 
Hi Prasanth,
 

Check below example that matches your requirement :- 

https://salesforce.stackexchange.com/questions/82904/password-protected-visualforce-page-rendered-as-pdf

https://hub.appirio.com/tech-blog/password-protect-pdf-docs-in-salesforce-using-heroku

Please mark it as the Best Answer so that it can help others in the future.

Regards,

Priya Ranjan

PRASANTH S 12PRASANTH S 12
Thanks for the reply
but how? archive this using Heroku any idea? give me
 
gvfdshg vgdfsgtfgvfdshg vgdfsgtf
If you are looking to send the password to the customer I will suggest you to take guide from here (https://elasticreviews.com/best-tennis-racquets/)  there are lots of solutions are avaialbel there.
Tony CantuTony Cantu
Yes, I would say that there are many kind of strategies which you can follow up to go for the next level of gaming experience such as https://www.proessaywriting.com/online-essay-writer/ where you can learn new articles about gaming and new moves will be shared for everybody anyway with full support
mukesh guptamukesh gupta
Hi Prasanath,

 Heroku can run java code and manipulate a pdf blob.

The final solution involved the following steps:
  • Salesforce generates the pdf, saves it as an attachment.
  • A workflow rule fires and invokes Heroku Java server via outbound messaging.
  • Record Id and Session Id are passed to Heroku server.
  • Heroku uses the Session Id and Record Id to query back the attachment data.
  • Java code is invoked on the attachment blob and password protects it.
  • The Attachment is saved back in Salesforce.
 
[snippet caption=”Java that runs on Heroku for password protection”]String desiredPassword = ‘“Topsecret”
try {
PdfReader pdfReader = new PdfReader(request.getInputStream());
PdfStamper pdfStamper = new PdfStamper(pdfReader ,resp.getOutputStream());
pdfStamper.setEncryption(desiredPassword.getBytes(), desiredPassword.getBytes(),
PdfWriter.ALLOW_PRINTING, PdfWriter.ENCRYPTION_AES_256 | PdfWriter.DO_NOT_ENCRYPT_METADATA);
if(pdfStamper != null) {
try {
pdfStamper.close();
} catch (DocumentException e) {
throw e
}
}
} catch (Exception e) {
e.printStackTrace();
throw e;
}[/snippet]

if you need any assistanse, Please let me know!!

Kindly mark my solution as the best answer if it helps you.

Thanks
Mukesh 
erwgd hbgfhgferwgd hbgfhgf
To send the password you can visit on some related links like this (https://www.freshbeautystudio.com/) and do this task in an easy way.