Encrypt and Secure Documents option allows you to protect the exported document such as PDF, Word, and Excel from unauthorized users by encrypting the document using the encryption password. The following code snippet explains how to encrypt the exported document with the user defined password.
You can protect the exported PDF document using the following code snippet.
writer.PDFOptions = new BoldReports.Writer.PDFOptions();
writer.PDFOptions.Security = new Syncfusion.Pdf.Security.PdfSecurity
{
UserPassword = "Password"
};
You can protect the exported Word document using the following code snippet.
writer.WordOptions = new BoldReports.Writer.WordOptions()
{
EncryptionPassword = "password"
};
You can protect the exported Excel document using the following code snippet.
writer.ExcelOptions = new BoldReports.Writer.ExcelOptions()
{
PasswordToModify = "password",
PasswordToOpen = "password"
};