TX Text Control .NET for WPF

What's New in TX Text Control .NET for WPF 25.0

Topic

Protected documents with editable regions are the center of version 25.0: a document can forbid editing, formatting, printing or copying, while selected parts stay editable for named users, and a new ribbon tab sets both up. TX Text Control .NET for WPF also received mini toolbars, a thesaurus dialog box and the UI Automation text pattern, and it allowed objects anywhere on a page from headers and footers.

Version 25.0 was released on December 13, 2017, as TX Text Control X15, together with TX Text Control .NET Server, TX Text Control .NET for Windows Forms, TX Text Control ActiveX and TX Spell .NET 7.0. Its last full installer is dated November 21, 2018. The features below are the ones added since version 24.0.

Version 25.0 at a Glance

AreaWhat is new
ProtectionDocument permissions and passwords, editable regions per user, the Permissions ribbon tab
User interfaceMini toolbars, selection of objects behind the text, a thesaurus dialog box
AccessibilityThe UI Automation text pattern
Headers and footersImages, text frames, barcodes and drawings anywhere on the page, such as watermarks
TablesPage break settings of paragraphs applied to table rows
.NET FrameworkTX Text Control .NET for WPF compiled with .NET Framework 4.5

Documents With Restricted Access

A document can restrict what users may do with it: edit it, format it, print it or copy its content to the clipboard. See Document Protection and Editable Regions.

  • Permissions. A DocumentPermissions object, returned by TextControl.DocumentPermissions, holds the restrictions: AllowCopy, AllowFormatting, AllowFormattingStyles, AllowPrinting and ReadOnly.
  • Activation. The restrictions take effect when TextControl.EditMode changes from Edit to ReadAndSelect. With the edit mode UsePassword, a dialog box asks for a password that protects the restrictions; the same password is needed to switch back to Edit.
  • In the document. The permissions and the password are saved in the document in encrypted form. A password-protected document opens read-only. The supported formats are RTF, DOC, DOCX, PDF and the TX Text Control format.

Editable Regions

An editable region is a piece of text that stays editable when the document is read-only.

Mini Toolbars

Besides context menus, TX Text Control offers built-in mini toolbars: small toolbars with the formatting options of the current context. See Toolbars and Mini Toolbars.

Selecting Objects in the Background

TextControl.SelectObjects decides what a mouse click selects when an object lies behind the text. With true, the click selects the object in the background; with false, it selects the text in front of it. The RibbonFormattingTab received a Select Objects button.

Thesaurus

TX Text Control finds synonyms for the word at the input position. The RibbonProofingTab received two buttons, one that loads thesaurus files from a directory and one that opens the built-in ThesaurusDialog. The thesaurus needs TX Spell .NET 7.0. See Integrating TX Spell .NET for WPF.

UI Automation

The WPF TextControl implements the text pattern of UI Automation, which exposes the text of a loaded document through text ranges. Accessibility tools use this information to make applications usable for people with vision, hearing or motion disabilities. See Accessibility and UI Automation.

Objects in Headers and Footers

While a header or footer is active, images, text frames, barcodes and drawings can be placed anywhere on the page. Such an object appears in the background of every page that shows the header or footer, which makes it suitable for watermarks and page backgrounds.

  • The object has to be positioned at a fixed position on the page: its InsertionMode, such as FrameBase.InsertionMode, must be FrameInsertionMode.FixedOnPage.
  • The height of the header or footer doesn't depend on the position of these objects.

See Headers and Footers and Images, Text Frames, and Shapes.

Pagination in Tables

The paragraph settings "keep with next" (ParagraphFormat.KeepWithNext) and "page break before" (ParagraphFormat.PageBreakBefore) control automatic page breaks, and since version 25.0 they work in tables as well. A table row can contain several paragraphs, so one of them decides for the whole row:

  • The first paragraph of a row decides. The pagination settings of all other paragraphs in the row are ignored.
  • Page break before. If the first paragraph of a row has this setting, the complete row moves to a new page.
  • Keep with next. If the first paragraph of a row has this setting, the row stays on the same page as the row that follows it.

The new value Pagination of the PermanentControlChar enumeration marks paragraphs with these settings. Tables and Table Formulas describes tables.

Other API Additions

.NET Framework

TX Text Control .NET for WPF 25.0 was compiled with .NET Framework 4.5. Deploying .NET Framework Applications describes the .NET Framework applications of today's version.

Upgrade to Version 25.0

  • Update notes. PageCollection.GetItem received an overload that returns the page at a text input position, and PermanentControlChar was extended with Pagination.
  • Breaking changes. No change of version 25.0 is known to break existing code. Breaking Changes starts with version 30.0.

New Classes, Properties, Methods and Events

These are the classes and members that the What's New documentation of version 25.0 lists for TX Text Control .NET for WPF. Names are relative to the TXTextControl namespace. Each name links to its current reference page.

New Classes

.NET Members by Class

ClassPropertiesMethodsEvents
DocumentPermissionsAllowCopy, AllowFormatting, AllowFormattingStyles, AllowPrinting, ReadOnly
EditableRegionDefaultHighlightColor, HighlightColor, HighlightMode, ID, Length, Number, Start, Text, UserNameSave, ScrollTo
EditableRegionCollectionCount, IsSynchronized, Item, SyncRootAdd, CopyTo, GetEnumerator, GetItem, GetItems, Remove
EditableRegionEventArgsEditableRegion
FrameBaseBounds
HeaderFooterEditableRegions
IFormattedTextEditableRegions
ServerTextControlEditableRegionsOnContentsReset, OnEditableRegionCreated, OnEditableRegionDeleted, OnSubTextPartCreated, OnSubTextPartDeleted, SelectWordContentsReset, EditableRegionCreated, EditableRegionDeleted, SubTextPartCreated, SubTextPartDeleted
TextFrameEditableRegions
WPF.MiniToolbarInitializedEventArgsMiniToolbar
WPF.MiniToolbarOpeningEventArgsHorizontalOffset, MiniToolbar, MiniToolbarContext, VerticalOffset
WPF.RibbonPermissionsTabAllowAddingUserNames, RegisteredUserNames
WPF.TextControlCanCharacterFormat, CanDocumentFormat, CanEdit, CanParagraphFormat, CanPrint, CanStyleFormat, CanTableFormat, DocumentPermissions, EditableRegions, RibbonPermissionsTab, SelectObjects, ShowMiniToolbar, UserNamesOnContentsReset, OnEditableRegionCreated, OnEditableRegionDeleted, OnEditableRegionEntered, OnEditableRegionLeft, OnMiniToolbarOpening, OnObjectMiniToolbarInitialized, OnSubTextPartCreated, OnSubTextPartDeleted, OnTextMiniToolbarInitialized, PointFromDocument, PointToDocument, SelectWordContentsReset, EditableRegionCreated, EditableRegionDeleted, EditableRegionEntered, EditableRegionLeft, MiniToolbarOpening, ObjectMiniToolbarInitialized, SubTextPartCreated, SubTextPartDeleted, TextMiniToolbarInitialized

Next Steps

  • Version 26.0: the features of the next version.
  • Version 24.0: the features of the previous version.
  • Older Versions: all versions from 29.0 back to 10.1.
  • TX Text Control X15 and TX Spell .NET 7.0 Released: the release announcement on the Text Control Blog.