cancel
Showing results for 
Search instead for 
Did you mean: 

Password in PDF Export from VS

0 Kudos

Hi there, I am using VS2013 with the CR for VS. My application exports invoices to PDF and then email it to customers. I would like to add security to the PDF files by adding a password to the PDF file. See below my code to create the PDF file. What is the best way to add the security? Thank you!!! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ cryRpt.Load("MyReport.rpt"); cryRpt.DataSourceConnections[0].SetConnection("", MainForm.jMainDB, false); cryRpt.RecordSelectionFormula = MySQL; cryRpt.SetParameterValue("rLogo", ncLogo); cryRpt.SetParameterValue("rTitle", lTitle); cryRpt.ExportToDisk(ExportFormatType.PortableDocFormat, lFN); cryRpt.Dispose(); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Accepted Solutions (1)

Accepted Solutions (1)

former_member188030
Active Contributor
0 Kudos

Hi Japie,

In my opinion, CR .NET SDK does not have control / handle over PDF but Crystal only.

So with CR SDK there are no APis to put a password for PDFs.

Possibly, you could write custom code using Adobe SDK to add password to exported PDF file ( if its possible, check with Adobe SDK forum) and call this code right after you export the report to pdf.

Thanks,

Bhushan

Answers (0)