Encrypt and Secure Documents
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.
Password Protected PDF document
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"
};Password Protected Word document
You can protect the exported Word document using the following code snippet.
writer.WordOptions = new BoldReports.Writer.WordOptions()
{
EncryptionPassword = "password"
};Password Protected Excel document
You can protect the exported Excel document using the following code snippet.
writer.ExcelOptions = new BoldReports.Writer.ExcelOptions()
{
PasswordToModify = "password",
PasswordToOpen = "password"
};