TX Text Control .NET Server

What's New in TX Text Control .NET Server 24.0

Topic

Version 24.0 let MailMerge merge JSON data and gave its events the location in the template where they occur. It also added user-defined document properties, colored paragraphs, typed exceptions and the DataSourceManager class, and it changed the handler type of an event that the Document Editor's server side uses, which can require a change to existing code.

Version 24.0 was released on November 30, 2016, as TX Text Control X14, together with TX Text Control .NET for Windows Forms, TX Text Control .NET for WPF 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

AreaWhat is new
Mail mergeJSON data, the template location in merge events, DataSourceManager
DocumentsUser-defined document properties, colored paragraphs, text fields by type
ErrorsTextEditorException, FilterException and LicenseLevelException
PDFImport of encrypted PDF documents
Document EditorDrag and drop of text, clippings of the view, a larger JavaScript API, JSON and object data
Document ViewerAn ASP.NET MVC Document Viewer with a JavaScript API

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 Data Sources.
  • Where an event occurred. Most events of a merge run tell where in the template they occurred. FieldMergedEventArgs, ImageMergedEventArgs and ImageFieldMergedEventArgs received MergeBlockName, NestingDepth and, depending on the class, TableCell and DataRow.
  • 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, MergeBlockInfo and MergeBlockSettings came with it. See Template Assistant.
  • JSON parser errors. The DocumentServer.Json namespace has exceptions such as ParserException for invalid JSON data.

Documents

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, an ArgumentNullException or an ArgumentOutOfRangeException, and a call that is invalid in the object's current state throws an InvalidOperationException.

See Troubleshooting for the errors of today's version.

PDF Import

Encrypted PDF documents can be loaded. The password to open the document is set with LoadSaveSettingsBase.UserPassword. See Load and Modify a PDF.

Document Editor

In version 24.0, the Document Editor was the ASP.NET Web Forms control Web.TextControl and the ASP.NET MVC extension Web.MVC.TextControl. Both are legacy technologies today, which ASP.NET on .NET Framework describes.

  • Drag and drop. Selected text can be dragged to another position. TextViewGenerator.AllowDrag and AllowDrop have to be true. See Editing Text.
  • Clippings of the view. View.GetImage received overloads that return a clipping of the view's image, and the Changed event of the View reports the clipping's position and size. When the view scrolls, because its location is set or because the input position leaves the visible part, ViewChangedEventArgs gives the scroll distance and orientation.
  • Zoom and ruler bars. TextViewGenerator.Zoom zooms by a factor or with the options WholePage, PageWidth and TextWidth, which show the whole page, the width of a page or the text of a line, and RulerBarViewGenerator.ReadOnly shows the attributes in a ruler bar without letting users change them.
  • Data for the editor. Besides XML files and data sets, the Web Forms editor Web.TextControl loads merge data from JSON with LoadDataFromJson and from objects with LoadDataFromModel, each also as an asynchronous method.
  • JavaScript API. The API grew substantially: it loads an XML database with loadXMLDatabase, loads and saves the selection, returns the text parts, sets the colors of the control and raises new events, which addEventListener attaches. The Ribbon object expands and minimizes the ribbon.

Document Viewer

An ASP.NET MVC version of the Document Viewer came with the namespace Web.MVC.DocumentViewer: the DocumentViewer extension, configured with DocumentViewerSettings and SignatureSettings. In the browser, the TXDocumentViewer object loads, saves, prints and searches documents. See Document Viewer.

Upgrade to Version 24.0

  • View.Changed has a new handler type. The handler type of ServerVisualization.View.Changed changed from System.EventHandler to ViewChangedEventHandler, which passes a ViewChangedEventArgs object to the handler. Code that attaches an EventHandler to the event has to change its handler's signature.
  • Update notes. DrawingFrame.Refresh received an overload that refreshes part of a drawing. MailMerge.MergeObjects also merges collections of System.Collections.Generic.Dictionary objects with string keys. View.GetImage received two overloads for clippings. CursorKind has the new values DragDropCopy, DragDropMove and No for the cursors of drag and drop, and DrawShapeEventArgs.Shape the value DropCaret, the rectangle that marks where dropped text is inserted.
  • JavaScript members marked obsolete. Several JavaScript members that version 24.0 added, such as TXTextControl.editMode and getTextParts, are marked obsolete in the current reference. The list below marks them.
  • Other breaking changes. 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 Server. .NET names are relative to the TXTextControl namespace. Each name links to its current reference page, and "(obsolete)" marks the members that are obsolete today.

New Classes

.NET Members by Class

ClassPropertiesMethodsEvents
DocumentServer.DataSources.DataColumnInfoCaption, ColumnName, DataTableInfo, DataType
DocumentServer.DataSources.DataColumnInfoCollectionCount, IsReadOnly, ItemCopyTo, GetEnumerator
DocumentServer.DataSources.DataRelationInfoChildColumnName, ChildTableName, ParentColumnName, ParentTableName, RelationName
DocumentServer.DataSources.DataRelationInfoCollectionCount, IsReadOnly, ItemCopyTo, GetEnumerator
DocumentServer.DataSources.DataSourceManagerConnectionString, DataProviderName, DataRelations, DataTables, IsMergingPossible, MasterDataTableInfo, PossibleMergeBlockTables, PossibleMergeFieldColumnsInsertMergeBlock, IsMergeBlock, LoadAssembly, LoadDataSet, LoadDataSourceConfig, LoadDataTable, LoadJson, LoadObjects, LoadSingleObject, LoadXmlFile, LoadXmlString, Merge, SaveDataSourceConfigConnectionStringChanged, DataProviderNameChanged, DataRelationsChanged, DataTablesChanged, IsMergingPossibleChanged, MasterDataTableInfoChanged, PossibleMergeBlockTablesChanged, PossibleMergeFieldColumnsChanged
DocumentServer.DataSources.DataTableInfoChildRelations, ChildTables, Columns, TableName
DocumentServer.DataSources.DataTableInfoCollectionCount, IsReadOnly, ItemCopyTo, GetEnumerator
DocumentServer.DataSources.MergeBlockInfoChildBlocks, ColumnNames, TableName
DocumentServer.DataSources.MergeBlockSettingsBlockTemplateType, CreateHeaderRow, FieldDisplayMode, HighlightColor
DocumentServer.MailMergeMergeBlockNamePrefixMergeJsonData
DocumentServer.MailMerge.DataRowMergedEventArgsDataRow
DocumentServer.MailMerge.FieldMergedEventArgsDataRow, MergeBlockName, NestingDepth, TableCell
DocumentServer.MailMerge.ImageFieldMergedEventArgsMergeBlockName, NestingDepth, TableCell
DocumentServer.MailMerge.ImageMergedEventArgsDataRow, MergeBlockName, NestingDepth
Drawing.ViewChangedEventArgsClipRectangle
FilterExceptionReason
FormattingStyleBaseStyle
FrameEventArgsFrame
HeaderFooterGetTextFields
IFormattedTextGetTextFields
InputFormatBottomAligned, FrameFillColor, FrameLineColor, FrameLineWidth, TopAligned, VerticallyCentered
LoadSaveSettingsBaseReportingMergeBlockFormat
LoadSettingsDocumentAccessPermissions, LoadDocumentBackColor, UserDefinedDocumentProperties
PageNumberFieldCollectionGetItem
PaperSizeHeight, Name, Width
ParagraphFormatAbsoluteLineSpacing, Alignment, BackColor, BottomDistance, Frame, FrameDistance, FrameLineColor, FrameLineWidth, FrameStyle, HangingIndent, LeftIndent, LineSpacing, RightIndent, TabPositions, TabTypes, TopDistance
SaveSettingsSaveDocumentBackColor, UserDefinedDocumentProperties
SelectionRemoveInlineStyles
ServerTextControlGetSupportedPaperSizes, GetTextFields, OnDocumentLoadedDocumentLoaded
ServerVisualization.RulerBarViewGeneratorReadOnly
ServerVisualization.TextViewGeneratorAllowDrag, AllowDropOnFrameDeselected, OnFrameSelected, ZoomFrameDeselected, FrameSelected
ServerVisualization.ViewGetUpdateRectangle
ServerVisualization.ViewChangedEventArgsClipRectangle, ScrollDistance, ScrollOrientation
TextFrameGetTextFields
UserDefinedPropertyDictionaryItem, Names, ValuesAdd, Contains, Remove
Web.MVC.DocumentViewer.ControlBaseRender
Web.MVC.DocumentViewer.ControlsFactoryDocumentViewer
Web.MVC.DocumentViewer.DocumentViewerSettingsBasePath, Dock, DocumentData, DocumentLoadSettings, DocumentPath, IsSelectionActivated, RenderMode, ResourceManager, ShowThumbnailPane, SignatureSettings, ToolbarDocked, View
Web.MVC.DocumentViewer.HtmlHelperExtensionTXTextControl
Web.MVC.DocumentViewer.SignatureSettingsCustomSignatureData, CustomSigning, DefaultSignatureFont, OwnerName, RedirectUrlAfterSignature, ShowSignatureBar, SignatureBoxName (obsolete), SignerInitials, SignerName, UniqueId
Web.MVC.TextControlLoadDataFromJson, LoadDataFromModel, LoadDataSet
Web.TextControlLoadDataFromJson, LoadDataFromJsonAsync, LoadDataFromModel, LoadDataFromModelAsync

Document Editor JavaScript API

Document Viewer JavaScript API

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.