Encryption Preferences Class.
コード例 #1
0
ファイル: PdfReport.cs プロジェクト: VahidN/PdfReport
        /// <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;
        }
コード例 #2
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);
        }