New Features
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 20.1.10.55. 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.
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.
Undo/Redo
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.
Mail Merge
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.
Web Editor
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.