New Features

TX Text Control 24.0 provides the following new features:

Windows Forms Ribbon Controls

The TXTextControl class library offers now classes to build Windows Forms applications with a ribbon instead of a menu and toolbars. The main window must inherit from the new RibbonForm class which can draw a Ribbon Quick Access Toolbar and contextual tabs in its border. An instance of the Ribbon, docked at the top of the main window, hosts an Application Menu as its first tab and organizes the features of an application into a series of tabs, presented through RibbonTab controls. These controls then host a variety of button and menu controls, organized in groups, that enable access to application commands. Predefined tabs, such as the RibbonFormattingTab or the RibbonInsertTab support all generic features of a TextControl, so that an application with rich text editing features can quickly be developed. A Ribbon can also contain groups of contextual tabs which dynamically displays controls that are only relevant in a particular context. A group can be added to the ContextualTabGroupCollection available through the ribbon's ContextualTabGroups property.

WPF Ribbon Controls

In addition to the WPF.RibbonFormattingTab and WPF.RibbonInsertTab classes five new predefined ribbon tabs have been added. The WPF.RibbonFrameLayoutTab can be used to alter the attributes of images, text frames, barcodes and drawings, the WPF.RibbonTableLayoutTab handles the layout and the attributes of a table and the WPF.RibbonPageLayoutTab has elements to set page attributes such as margins, page size, columns and document frames. The WPF.RibbonProofingTab can be used to check spelling and hyphenation and the WPF.RibbonViewTab offers elements to alter the document's view. All classes are inherited from the System.Windows.Controls.Ribbon.RibbonTab class and can be hosted in a System.Windows.Controls.Ribbon.Ribbon object. They can be connected with a WPF.TextControl through the WPF.TextControl.RibbonFrameLayoutTab, WPF.TextControl.RibbonTableLayoutTab, WPF.TextControl.RibbonPageLayoutTab WPF.TextControl.RibbonProofingTab and WPF.TextControl.RibbonViewTab properties.

Colored Paragraphs

A paragraph's background and the lines of a paragraph frame can be colored. The properties ParagraphFormat.BackColor and ParagraphFormat.FrameLineColor can be used to get or to set such colors. The InputFormat class, the built-in dialog box for setting paragraph attributes, the TX Text Control file format and all text filters have been extended to support this feature.

Zooming

Zooming has been extended with new zoom options. These options can be used to zoom the contents of a TextControl or WPF.TextControl so that either the whole page, the complete width of a page or the complete text of a line becomes visible. They can be used with the new Zoom method. The StatusBar and WPF.StatusBar have been extended with two new buttons to support this feature.

User-Defined Document Properties

User-defined document properties can now be saved and loaded with the TX Text Control file format, the Rich Text Format (rtf) and the Microsoft Word formats (doc, docx). The new SaveSettings.UserDefinedDocumentProperties property accepts an object of the type UserDefinedPropertyDictionary which can contain a number of document properties, which are saved in the document. The dictionary allows properties of the types System.String, System.Boolean, System.Int32 and System.Double. After a document has been loaded these properties are available through the LoadSettings.UserDefinedDocumentProperties property.

Toolbars

The ButtonBar, RulerBar and WPF.RulerBar can be set to read only now. When such a tool bar is set to read only, it still shows all formatting attributes of the connected TextControl or WPF.TextControl, but formatting attributes cannot be changed.

TextField Programming

The new IFormattedText.GetTextFields method returns a collection of text fields of one or more field types. When more than one field type is specified the returned collection contains all fields of these types in the same order as the fields are contained in the document. The new PageNumberFieldCollection.GetItem method gets a particular page number field from a page number field collection.

Text Formatting

The InputFormat class has some new properties which support the setting of colors, frames and text alignment. The InputFormat.TopAligned, InputFormat.BottomAligned and InputFormat.VerticallyCentered properties can be used to set the text alignment, InputFormat.FrameFillColor and InputFormat.FrameLineColor set colors for the table cell background and the frame color and InputFormat.FrameLineWidth sets the width of frame lines.

PDF Import

PDF import now supports encrypted files. Please refer to the chapter Loading Encrypted PDF files in the Technical Articles part of this manual.

Error Handling

New classes have been implemented to enable a better exception handling. A TextControl throws a TextEditorException when an error occurs during text editing and a FilterException, if an error occurs when a text filter is used to convert a document to or from another format. The LicenseLevelException is thrown, when a feature is not contained in the currently licensed product level. The TX Text Control class library explicitly throws an ArgumentException, an ArgumentNullException or an ArgumentOutOfRangeException, when the parameter of a called method or the value of a set property has a wrong value. Furthermore, an InvalidOperationException is thrown when a method call is invalid for the object's current state.

Sections and Pages

The new TextControl.GetSupportedPaperSizes and WPF.TextControl.GetSupportedPaperSizes methods return the names and the sizes of all currently supported paper sizes. These paper sizes depend on the formatting device set with the TextControl.FormattingPrinter or WPF.TextControl.FormattingPrinter property.

Server Visualization

The ServerVisualization.View class provides further overloads of the GetImage method to get a clipping of the view's image. The view's Changed event informs about the clipping's position and size. When the view must be updated as a result of scrolling, the new ServerVisualization.ViewChangedEventArgs class provides information about the distance and the scroll orientation. Scrolling occurs either through setting the view's location in the document or through autoscrolling initiated through the control when the input position leaves the visible part of the document. Selected text can now be dragged and dropped at another position in the document. The TextViewGenerator.AllowDrag and TextViewGenerator.AllowDrop properties must be set to true to switch on this feature.

Mail Merge and Reporting

The MailMerge class now provides the possibility to merge JSON data via the method MailMerge.MergeJsonData. The JSON data can contain either a single object or an array of equally structured objects. Furthermore, most of the events fired during a merge process have been enhanced in such a way that it is easier to figure out from where inside the document template the event was fired.

Web Editor

In addition to XML files and DataSet objects the web editor can now also handle JSON and object based data sources via the new methods LoadDataFromJson and LoadDataFromModel.

Web Editor Programming

The JavaScript API of the Text Control Web Editor has been enhanced substantially. For example, it is now possible to load an XML database, set and load text into the current selection, retrieve the document text parts or set the control colors via new JavaScript functions and properties. Also a few events which are fired by the editor have been added (see TXTextControl.addEventListener).