TX Text Control 23.0 provides the following new features:
Drawings and Shapes
TX Text Control now supports the insertion of drawings and preset shapes defined by ISO/IEC 29500-1 in section 18.104.22.168. A drawing represents a single shape or a canvas including a number of shapes. It can be positioned like an image or textframe, either geometrically or as a single character. Geometrically, its position can either be relative to a paragraph to which it is anchored or relative to the complete document. The new DrawingFrame class handles the positioning of the drawing in the document. A drawing frame is always associated with a Drawing.TXDrawingControl or WPF.Drawing.TXDrawingControl which handles the appearance and the data of the drawing. A drawing can be activated and its contained shapes can be altered through the user with built-in mouse and keyboard interfaces. A drawing control is also fully programmable, its contained shapes are accessible through a Drawing.ShapeCollection. All drawings in a document are contained in a DrawingCollection. The collection can also be used to add drawings to or to remove drawings from the document. The drawing collection can be obtained through the TextControl.Drawings, WPF.TextControl.Drawings or ServerTextControl.Drawings property. The TextControl.DrawingLayoutDialog and WPF.TextControl.DrawingLayoutDialog methods opens a dialog box, which offers layout settings such as positioning, size and text distances. A drawing can be saved and loaded with the TX Text Control format and the Microsoft Word format (.docx). With other formats the drawing's bitmap image is saved.
New Built-in Windows Forms Dialog Boxes
TXTextControl for Windows Forms provides additional built-in dialog boxes for inserting, editing and deleting hyperlinks and bookmarks. The HyperlinkDialog class provides a dialog box to insert either a HypertextLink to an external location or a DocumentLink to a location in the same document. If there is a link at the current input position, the data of the link is shown and can be edited or the link can be deleted. The BookmarkDialog class provides a dialog box to insert a bookmark at the current text input position. If there is a bookmark at the current input position, the name of the bookmark is shown and can be edited. The DeleteBookmarksDialog class is a dialog box which shows all bookmarks in the current document. The user can jump to a bookmark or can delete one or more bookmarks. The GotoDialog dialog box can be used to move the current input position to a certain page, section, line, table or bookmark. The new input position is shown with a marker.
Programming Formatted Text
A TX Text Control document consists of the main text, and additionally other pieces of text such as text frames and headers or footers which are called textparts. A programmer can define now smaller parts called subtextparts to perform operations on smaller pieces of text. A SubTextPart can be defined through a start character index and a length or through a selection. All subtextparts are contained in a SubTextPartCollection which can be obtained with the TextControl.SubTextParts, TextFrame.SubTextParts or HeaderFooter.SubTextParts property. The collection can be used to add or to remove a subtextpart. A SubTextPart can be programmatically identified through a name or an identifier and it can be highlighted on the screen either permanently or only when it contains the current text input position. Each subtextpart can contain further nested subtextparts, but subtextparts cannot overlap. Its contents can be saved in a byte array or a string with all formats which TX Text Control supports.
A user-defined undo step can be defined with the new BeginUndoAction and EndUndoAction methods. All editing and fomatting changes made between these methods belong to the undo operation. All these changes are undone or redone in a single step. The user can define a name which is available with the UndoActionName property.
Inserting Text Frames, Barcodes and Drawings
A new built-in mouse interface can be used to insert a text frame, a drawing or a barcode into the document. A further Add method has been added to the appropriate collection receiving a TextFrame, BarcodeFrame and DrawingFrame object and a FrameInsertionMode value. The end-user can then click into the document and draw a frame which determines the postion of the item. After releasing the mouse button the new item is created and inserted into the document.
The new DocumentServer.MailMerge.MergeObject method takes a single object as a merge data source. This makes it more convenient to merge a single "row" of object based data which until now had to be enclosed in an enumerable type (e. g. an array or a list) before being merged. Repeating merge blocks in mail merge templates are now realized with SubTextParts instead of document targets. Old templates can still be loaded.
It is now possible to set the culture and the UI culture of the web editor programmatically with the Web.TextControl.Culture and Web.TextControl.UICulture properties. If no culture is set, the browser language is used to determine the displayed string resources and units of measurement. It is no longer necessary to run the TX TextControl web service on the same machine as the IIS web server hosting the web editor. With the new properties Web.TextControl.ServiceAddress and Web.TextControl.ServicePort, it is now possible to connect to a service running on another physical server. This allows using a load balancer, for example.