See Also

Document Class  | Document Members

Requirements

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

Language

Visual Basic

C#

Show All

Gets or sets an object to control the security and encryption of the Document.

[Visual Basic]
Public Property Security As Security
[C#]
public Security Security {get; set;}

Remarks

This object controls the encryption and security of the generated PDF document.

Example

The following example will set the high security of the document so that the anyone who logs in with the user password will not be able to print at high resolution, edit or add annotations or form fields, or access this document from other accessibility programs.

[Visual Basic] 

Imports System
Imports ceTe.DynamicPDF
Imports ceTe.DynamicPDF.PageElements

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 high security object
        Dim security As HighSecurity = New HighSecurity("owner", "user")

        ' Set the permissions on that security object
        security.AllowAccessibility = False
        security.AllowDocumentAssembly = False
        security.AllowHighResolutionPrinting = 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 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

[C#] 

using System; 
using ceTe.DynamicPDF; 
using ceTe.DynamicPDF.PageElements; 
 
class MyClass 

    static void Main() 
    { 
        // 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 high security object 
        HighSecurity security = new HighSecurity( "owner", "user" ); 
 
        // Set the permissions on that security object 
        security.AllowAccessibility = false; 
        security.AllowDocumentAssembly = 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 128 bit encryption."; 
        page.Elements.Add( new Label( text, 50, 50, 400, 100, Font.Helvetica, 18 ) ); 
 
        // Save the PDF 
        document.Draw( @"C:\MyDocument.pdf" ); 
    } 
}

Licensing

This property is a DynamicPDF Generator Enterprise Edition feature. One of the following licenses is required for non-evaluation usage:

Requirements

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

See Also

Document Class  | Document Members

 

 


© Copyright 2007, ceTe Software