Encryption Preferences Class.
Exemple #1
0
        /// <summary>
        /// Sets the encryption preferences for this document.
        /// </summary>
        /// <param name="pdfRptEncryptedFileBuilder">encryption preferences builder</param>
        /// <returns></returns>
        public PdfReport Encrypt(Action<EncryptedFileBuilder> pdfRptEncryptedFileBuilder)
        {
            var builder = new EncryptedFileBuilder();
            pdfRptEncryptedFileBuilder(builder);

            if (DataBuilder.DocumentSecurity == null)
                DataBuilder.DocumentSecurity = new DocumentSecurity();

            DataBuilder.DocumentSecurity.EncryptionPreferences = builder.EncryptionPreferences;
            return this;
        }
        /// <summary>
        /// Sets the encryption preferences for this document.
        /// </summary>
        /// <param name="pdfRptEncryptedFileBuilder">encryption preferences builder</param>
        /// <returns></returns>
        public PdfReport Encrypt(Action <EncryptedFileBuilder> pdfRptEncryptedFileBuilder)
        {
            var builder = new EncryptedFileBuilder();

            pdfRptEncryptedFileBuilder(builder);

            if (DataBuilder.DocumentSecurity == null)
            {
                DataBuilder.DocumentSecurity = new DocumentSecurity();
            }

            DataBuilder.DocumentSecurity.EncryptionPreferences = builder.EncryptionPreferences;
            return(this);
        }