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.
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 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.
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.
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 now supports encrypted files. Please refer to the chapter Loading Encrypted PDF files in the Technical Articles part of this manual.
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.
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.
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