What's New in TX Text Control .NET for WPF 24.0
Six predefined ribbon tabs arrived in TX Text Control .NET for WPF with version 24.0, among them tabs for frames, tables, the page layout, proofing, the view and reporting. MailMerge learned to merge JSON data, and the version added user-defined document properties, colored paragraphs, new zoom options and exception classes that tell what went wrong.
Version 24.0 was released on November 30, 2016, as TX Text Control X14, together with TX Text Control .NET Server, TX Text Control .NET for Windows Forms and TX Text Control ActiveX. Its last full installer, that of Service Pack 2, is dated June 13, 2017. The features below are the ones added since version 23.0.
Version 24.0 at a Glance
| Area | What is new |
|---|---|
| Ribbon | Tabs for frame layout, table layout, page layout, proofing, the view and reporting |
| Mail merge | JSON data, the template location in merge events, DataSourceManager, merge block dialog boxes |
| Documents | User-defined document properties, colored paragraphs, text fields by type, paper sizes |
| Viewing | Zooming to the whole page, the page width or the text width |
| Errors | TextEditorException, FilterException and LicenseLevelException |
| Import of encrypted PDF documents |
Ribbon Tabs
Besides RibbonFormattingTab and RibbonInsertTab, TX Text Control offers these predefined ribbon tabs:
| Ribbon tab | What it does | Connected through |
|---|---|---|
| RibbonFrameLayoutTab | Changes the attributes of images, text frames, barcodes and drawings | TextControl.RibbonFrameLayoutTab |
| RibbonTableLayoutTab | Handles the layout and the attributes of a table | TextControl.RibbonTableLayoutTab |
| RibbonPageLayoutTab | Sets page attributes such as margins, page size, columns and document frames | TextControl.RibbonPageLayoutTab |
| RibbonProofingTab | Checks spelling and hyphenation | TextControl.RibbonProofingTab |
| RibbonViewTab | Changes the view of the document | TextControl.RibbonViewTab |
| RibbonReportingTab | Integrates mail merge and reporting | TextControl.RibbonReportingTab |
All tabs derive from System.Windows.Controls.Ribbon.RibbonTab and are hosted in a System.Windows.Controls.Ribbon.Ribbon. See Ribbon.
Mail Merge
MailMerge creates documents from a template and data.
- JSON data. MailMerge.MergeJsonData merges JSON data: a single object or an array of objects with the same structure. See JSON and XML.
- Where an event occurred. Most events of a merge run tell where in the template they occurred. FieldMergedEventArgs, ImageMergedEventArgs and
ImageFieldMergedEventArgsreceived MergeBlockName,NestingDepthand, depending on the class,TableCellandDataRow. - Merge block prefix. MailMerge.MergeBlockNamePrefix is new.
- Data source information. DataSourceManager loads data from data sets, data tables, JSON, XML, objects and assemblies, describes its tables, columns and relations, inserts merge blocks and merges. The classes
DataTableInfo,DataColumnInfo,DataRelationInfo,MergeBlockInfoandMergeBlockSettingscame with it. RibbonReportingTab.DataSourceManager connects it to the Reporting tab. - Dialog boxes. The
DocumentServer.WPFnamespace received InsertMergeBlockDialog, EditMergeBlocksDialog and EditDataRelationsDialog, which insert merge blocks, edit them and add or remove the relations of a data source. - JSON parser errors. The
DocumentServer.Jsonnamespace has exceptions such as ParserException for invalid JSON data.
Documents
- User-defined document properties. SaveSettings.UserDefinedDocumentProperties takes a UserDefinedPropertyDictionary of properties with values of the types
String,Boolean,Int32andDouble. They are saved with the TX Text Control format, RTF, DOC and DOCX, and after loading, LoadSettings.UserDefinedDocumentProperties returns them. See Document Properties. - Colored paragraphs. ParagraphFormat.BackColor sets the background color of a paragraph and ParagraphFormat.FrameLineColor the color of its frame lines. The paragraph dialog box, the TX Text Control format and all text filters support both. See Text, Paragraphs, and Stylesheets.
- Text fields by type. IFormattedText.GetTextFields and TextControl.GetTextFields return the text fields of one or more types. With several types, the fields are in the order of the document. PageNumberFieldCollection.GetItem gets one page number field.
- Input formatting. InputFormat received TopAligned,
BottomAlignedandVerticallyCenteredfor the text alignment, FrameFillColor andFrameLineColorfor the background of table cells and the frame color, andFrameLineWidth. - Paper sizes. TextControl.GetSupportedPaperSizes returns the names and sizes of the supported paper sizes as PaperSize objects. They depend on the formatting device set with TextControl.FormattingPrinter. GetSupportedFonts is also new.
- More. Selection.RemoveInlineStyles, FormattingStyle.BaseStyle, LoadSaveSettingsBase.ReportingMergeBlockFormat and the DocumentLoaded event of
TextControlare also new.
Frames and Dialog Boxes
- Frame events.
TextControlraises events for all kinds of frames, such as FrameClicked, FrameMoved,FrameSized,FrameSelectedandFrameDeselected, each with a FrameEventArgs object. TextFrameAppearanceChanged is also new. - Color dialog boxes. FrameFillColorDialog, FrameLineColorDialog and PageColorDialog open dialog boxes for these colors.
Zooming
TextControl.Zoom takes a ZoomOption that calculates the zoom factor so that the whole page (WholePage), the width of a page (PageWidth) or the text of a line (TextWidth) becomes visible. The StatusBar received two buttons for these options. See Viewing, Zooming, and Navigation.
Error Handling
New exception classes tell what went wrong:
- A TextEditorException is thrown when an error occurs while text is edited.
- A FilterException is thrown when a text filter fails to convert a document to or from another format. Reason gives the cause.
- A LicenseLevelException is thrown when a feature isn't part of the licensed product level.
- A wrong parameter or property value throws an
ArgumentException, anArgumentNullExceptionor anArgumentOutOfRangeException, and a call that is invalid in the object's current state throws anInvalidOperationException.
PDF Import
Encrypted PDF documents can be loaded. The password to open the document is set with LoadSaveSettingsBase.UserPassword. See Passwords and Access Permissions.
Upgrade to Version 24.0
- Update notes. DrawingFrame.Refresh received an overload that refreshes part of a drawing. MailMerge.MergeObjects also merges collections of
System.Collections.Generic.Dictionaryobjects with string keys. CursorKind has the new valuesDragDropCopy,DragDropMoveandNofor the cursors of drag and drop. - Drawings. Drawing.ViewChangedEventArgs, also new, provides the data of the
ViewChangedevent of a drawing control. - Breaking changes. No change of version 24.0 is known to break WPF code. The changed handler type of
View.Changedthat the What's New documentation of this version names concerns the server-side view classes of the Document Editor, which TX Text Control .NET for WPF doesn't include. Breaking Changes starts with version 30.0.
New Classes, Properties, Methods and Events
These are the classes and members that the What's New documentation of version 24.0 lists for TX Text Control .NET for WPF, without the ASP.NET classes that the list also names. Names are relative to the TXTextControl namespace. Each name links to its current reference page.
New Classes
- DocumentServer.DataSources.DataColumnInfo
- DocumentServer.DataSources.DataColumnInfoCollection
- DocumentServer.DataSources.DataRelationInfo
- DocumentServer.DataSources.DataRelationInfoCollection
- DocumentServer.DataSources.DataSourceManager
- DocumentServer.DataSources.DataTableInfo
- DocumentServer.DataSources.DataTableInfoCollection
- DocumentServer.DataSources.MergeBlockInfo
- DocumentServer.DataSources.MergeBlockSettings
- DocumentServer.Json.InvalidCodePointException
- DocumentServer.Json.InvalidNumberFormatException
- DocumentServer.Json.ParserException
- DocumentServer.Json.UnexpectedEndOfInputException
- DocumentServer.Json.UnexpectedTokenException
- DocumentServer.Json.UnknownLiteralNameTokenException
- DocumentServer.Json.UnknownParseErrorException
- DocumentServer.WPF.EditDataRelationsDialog
- DocumentServer.WPF.EditMergeBlocksDialog
- DocumentServer.WPF.InsertMergeBlockDialog
- Drawing.ViewChangedEventArgs
- FilterException
- FrameEventArgs
- LicenseLevelException
- PaperSize
- ParagraphFormat
- TextEditorException
- UserDefinedPropertyDictionary
- WPF.RibbonFrameLayoutTab
- WPF.RibbonPageLayoutTab
- WPF.RibbonProofingTab
- WPF.RibbonReportingTab
- WPF.RibbonTableLayoutTab
- WPF.RibbonViewTab
.NET Members by Class
Next Steps
- Version 25.0: the features of the next version.
- Version 23.0: the features of the previous version.
- Older Versions: all versions from 29.0 back to 10.1.
- TX Text Control X14 for Windows Forms, WPF, ASP.NET and ActiveX Released: the release announcement on the Text Control Blog.