RC4128Security

Represents RC4 128 bit PDF document security.

public class RC4128Security : Security
Public Class RC4128Security
    Inherits Security

Inheritance: ObjectSecurityRC4128Security

Licensing Info

This class is a full DynamicPDF Core Suite feature. One of the following is required for non-evaluation usage:

Examples

The following example will set the RC4 security of the document so that the anyone who logs in with the user password will not be able to edit annotations or form fields.
Imports System
Imports ceTe.DynamicPDF
Imports ceTe.DynamicPDF.PageElements
Imports ceTe.DynamicPDF.Cryptography
     
Module MyModule
     		
    Sub Main()
     
        ' Create a PDF Document
        Dim MyDocument As Document = New Document 
     
        ' Create a Page and add it to the document
        Dim MyPage As Page = New Page
        MyDocument.Pages.Add(MyPage)
     
        ' Create a RC4 128 bit security object
        Dim security As RC4128Security = New RC4128Security("owner", "user")
     
        ' Set these properties to make form fields read only
        security.AllowFormFilling = False
        security.AllowEdit = False
        security.AllowUpdateAnnotsAndFields = False
     
        ' Add the security object to the document
        MyDocument.Security = security
     
        ' Create and display a label as a reference
        Dim text As String = "This document has been encrypted with RC4 128 bit encryption."
        MyPage.Elements.Add(New Label(text, 50, 50, 400, 100, Font.Helvetica, 18))
     
        ' Save the PDF
        MyDocument.Draw("C:\MyDocument.pdf")
     
    End Sub
End Module
using System;
using ceTe.DynamicPDF;
using ceTe.DynamicPDF.PageElements;
using ceTe.DynamicPDF.Cryptography;

public class Example
{
    public static void CreatePDF(string outputPath)
    {
        // Create a PDF Document
        Document document = new Document();

        // Create a Page and add it to the document
        Page page = new Page();
        document.Pages.Add( page );

        // Create a RC4 128 bit security object
        RC4128Security security = new RC4128Security( "owner", "user" );

        // Set these properties to make form fields read only
        security.AllowFormFilling = false;
        security.AllowEdit = false;
        security.AllowUpdateAnnotsAndFields = false;

        // Add the security object to the document
        document.Security = security;

        // Create and display a label as a reference
        string text = "This document has been encrypted with RC4 128 bit encryption.";
        page.Elements.Add( new Label( text, 50, 50, 400, 100, Font.Helvetica, 18 ) );

        // Save the PDF
        document.Draw( outputPath );
    }
}

Remarks

RC4 128 bit PDF security, with UseCryptFilter property set to false is compatible with PDF version 1.4 or higher and can be read with Adobe Acrobat Reader version 5 or higher. By default UseCryptFilter property is false. RC4 128 bit PDF security with crypt filter is compatible with PDF version 1.5 or higher and can be read with Adobe Acrobat Reader version 6 and higher. Older readers will not be able to read document encrypted with this security. For more details on RC4 128 bit security take a look at the Security topic.

Constructors

RC4128Security()Initializes a new instance of the RC4128Security class.
RC4128Security(String)Initializes a new instance of the RC4128Security class.
RC4128Security(String, String)Initializes a new instance of the RC4128Security class.

Properties

AllowAccessibilityGets or sets if accessibility programs should be able to read the documents text and images for the user.
AllowCopyGets or sets if text and images can be copied to the clipboard by the user.
(Inherited from Security)
AllowDocumentAssemblyGets or sets if the document can be assembled and manipulated by the user.
AllowEditGets or sets if the document can be edited by the user.
(Inherited from Security)
AllowFormFillingGets or sets if form filling should be allowed by the user.
AllowHighResolutionPrintingGets or sets if the document can be printed at a high resolution by the user.
AllowPrintGets or sets if the document can be printed by the user.
(Inherited from Security)
AllowUpdateAnnotsAndFieldsGets or sets if annotations and form fields can be added, edited and modified by the user.
(Inherited from Security)
EncryptMetadataGets or sets if the document metadata to be encrypted. Valid only when UseCryptFilter property is true.
OwnerPasswordGets or sets the owner password.
(Inherited from Security)
UseCryptFilterGets or sets if the encryption should be done with crypt filters.
UserPasswordGets or sets the user password.
(Inherited from Security)

Methods

Draw(DocumentWriter, Encrypter)Draws the encrypter dictionary to the given DocumentWriter object.
Equals(Object)Determines whether the specified Object is equal to the current Object .
(Inherited from Object)
GetEncrypter(Byte[])Gets a 128 bit Encrypter object to be used for encrypting the document.
GetHashCode()Serves as a hash function for a particular type.
(Inherited from Object)
GetType()Gets the Type of the current instance.
(Inherited from Object)
ToString()Returns a String that represents the current Object .
(Inherited from Object)

See Also

ceTe.DynamicPDF.Cryptography

In this topic