Restricted Document Access

TextControl can edit documents with restrictions such as forbid editing, printing, formatting or copying contents to the clipboard. These restrictions can be specified with the DocumentPermissions property of a TextControl or WPF.TextControl and they are activated, if the EditMode property is changed from Edit to ReadAndSelect. If UsePassword is specified with the EditMode property, a dialog box is opened where the user can enter a password which protects the restrictions. To unprotect the document the same password must be entered when the edit mode is reset to Edit. The set of permissions and the password are saved in the document in an encrypted form. When a password protected document is loaded it is opened read only. Supported text formats are RTF, Microsoft Word (DOC and DOCX), Adobe PDF and the TX TextControl text format (TX). Editable regions are pieces of text that remain editable when the EditMode property has been set to ReadAndSelect. An editable region can be defined through a start position and a length or through a selection and they can overlap. All editable regions are contained in a EditableRegionCollection which can be obtained with the TextControl.EditableRegions, TextFrame.EditableRegions or HeaderFooter.EditableRegions property. These collections can be used to add or to remove an editable region. Each editable region is related to a user through the UserName property. Only this user can edit the region, when the document has been set to read only. To specify the users who have access to the document the UserNames property must be used. To specify that everyone can edit a certain region the user name must be an empty string. Events occur, when an editable region is created (EditableRegionCreated), deleted (EditableRegionDeleted), entered (EditableRegionEntered) or left (EditableRegionLeft). An editable region is highlighted on the screen. By default the highlight color depends on the user name, but it can be set to a certain value with the EditableRegion.HighlightColor property. To provide a user-interface for specifying restrictions and adding editable regions, the Windows.Forms.Ribbon.RibbonPermissionsTab and WPF.RibbonPermissionsTab have been added to the number of predefined ribbon tabs.

Classes

Class Description
TXTextControl.DocumentPermissions The DocumentPermissions class provides settings determining how the document can be edited, when the EditMode is changed from Edit to ReadAndSelect.
TXTextControl.EditableRegion An EditableRegion object represents an editable region in a TX Text Control document.
TXTextControl.EditableRegionCollection Contains all editable regions in the main text or another part of a document.
TXTextControl.EditableRegionEventArgs The EditableRegionEventArgs class provides data for the EditableRegionCreated, EditableRegionDeleted, EditableRegionEntered and EditableRegionLeft events.
TXTextControl.Windows.Forms.Ribbon.RibbonPermissionsTab The RibbonPermissionsTab class represents a Windows Forms ribbon tab for determining how the document can be edited, when it is enforced to be protected.
TXTextControl.WPF.RibbonPermissionsTab The RibbonPermissionsTab class represents a Windows Forms ribbon tab for determining how the document can be edited, when it is enforced to be protected.

Properties

Property Description
TXTextControl.ServerTextControl.EditableRegions Gets a collection of all editable regions contained in the document.
TXTextControl.TextControl.CanCharacterFormat Informs whether the currently selected text can be formatted with character formatting attributes.
TXTextControl.TextControl.CanCopy Informs whether a part of a Text Control document has been selected and can be copied to the clipboard.
TXTextControl.TextControl.CanDocumentFormat Informs whether the document can be formatted with page and section formatting attributes.
TXTextControl.TextControl.CanEdit Informs whether the document's text and/or formatting attributes can be changed.
TXTextControl.TextControl.CanParagraphFormat Informs whether the currently selected text can be formatted with paragraph formatting attributes.
TXTextControl.TextControl.CanPaste Informs whether the clipboard contains a format that can be pasted into a Text Control document.
TXTextControl.TextControl.CanPrint Informs whether the document can be printed.
TXTextControl.TextControl.CanStyleFormat Informs whether the document can be formatted with formatting styles.
TXTextControl.TextControl.CanTableFormat Informs whether the currently selected text can be formatted with table formatting attributes.
TXTextControl.TextControl.DocumentPermissions Gets a DocumentPermissions object which provides properties determining how a document can be edited and formatted when the EditMode property is set to EditMode.ReadAndSelect.
TXTextControl.TextControl.EditableRegions Gets a collection of all editable regions contained in the document.
TXTextControl.TextControl.UserNames Gets or sets a list of names specifying users who have access to editable regions.
TXTextControl.WPF.TextControl.CanCharacterFormat Informs whether the currently selected text can be formatted with character formatting attributes.
TXTextControl.WPF.TextControl.CanCopy Informs whether a part of a Text Control document has been selected and can be copied to the clipboard.
TXTextControl.WPF.TextControl.CanDocumentFormat Informs whether the document can be formatted with page and section formatting attributes.
TXTextControl.WPF.TextControl.CanEdit Informs whether the document's text and/or formatting attributes can be changed.
TXTextControl.WPF.TextControl.CanParagraphFormat Informs whether the currently selected text can be formatted with paragraph formatting attributes.
TXTextControl.WPF.TextControl.CanPaste Informs whether the clipboard contains a format that can be pasted into a Text Control document.
TXTextControl.WPF.TextControl.CanPrint Informs whether the document can be printed.
TXTextControl.WPF.TextControl.CanStyleFormat Informs whether the document can be formatted with formatting styles.
TXTextControl.WPF.TextControl.CanTableFormat Informs whether the currently selected text can be formatted with table formatting attributes.
TXTextControl.WPF.TextControl.DocumentPermissions Gets a DocumentPermissions object which provides properties determining how a document can be edited and formatted when the EditMode property is set to EditMode.ReadAndSelect.
TXTextControl.WPF.TextControl.EditableRegions Gets a collection of all editable regions contained in the document.
TXTextControl.WPF.TextControl.UserNames Gets or sets a list of names specifying users who have access to editable regions.

Methods

Method Description
TXTextControl.ServerTextControl.OnEditableRegionCreated Raises the EditableRegionCreated event.
TXTextControl.ServerTextControl.OnEditableRegionDeleted Raises the EditableRegionDeleted event.
TXTextControl.TextControl.OnEditableRegionCreated Raises the EditableRegionCreated event.
TXTextControl.TextControl.OnEditableRegionDeleted Raises the EditableRegionDeleted event.
TXTextControl.TextControl.OnEditableRegionEntered Raises the EditableRegionEntered event.
TXTextControl.TextControl.OnEditableRegionLeft Raises the EditableRegionLeft event.
TXTextControl.WPF.TextControl.OnEditableRegionCreated Raises the EditableRegionCreated event.
TXTextControl.WPF.TextControl.OnEditableRegionDeleted Raises the EditableRegionDeleted event.
TXTextControl.WPF.TextControl.OnEditableRegionEntered Raises the EditableRegionEntered event.
TXTextControl.WPF.TextControl.OnEditableRegionLeft Raises the EditableRegionLeft event.

Events

Event Description
TXTextControl.ServerTextControl.EditableRegionCreated Occurs when an editable region has been created.
TXTextControl.ServerTextControl.EditableRegionDeleted Occurs when an editable region has been deleted.
TXTextControl.TextControl.EditableRegionCreated Occurs when an editable region has been created.
TXTextControl.TextControl.EditableRegionDeleted Occurs when an editable region has been deleted.
TXTextControl.TextControl.EditableRegionEntered Occurs when the current input position has been moved to a position that belongs to an editable region.
TXTextControl.TextControl.EditableRegionLeft Occurs when the current input position has left an editable region.
TXTextControl.WPF.TextControl.EditableRegionCreated Occurs when an editable region has been created.
TXTextControl.WPF.TextControl.EditableRegionDeleted Occurs when an editable region has been deleted.
TXTextControl.WPF.TextControl.EditableRegionEntered Occurs when the current input position has been moved to a position that belongs to an editable region.
TXTextControl.WPF.TextControl.EditableRegionLeft Occurs when the current input position has left an editable region.