New Features
TX Text Control 24.0 provides the following new features:
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.
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.
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).