TX Text Control .NET Server

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

Topic

Form fields and the rules that connect them are the main addition of version 28.0. Document targets, the bookmarks of a document, changed their class hierarchy in this version, which can require changes to existing code, and the Document Editor's JavaScript API grew to cover most of the .NET object model.

Version 28.0 was released on March 16, 2020, as TX Text Control X18, together with TX Text Control .NET for Windows Forms, TX Text Control .NET for WPF and TX Text Control ActiveX. The last full installer of version 28.0 is dated October 26, 2020, shortly after Service Pack 4. The features below are the ones added since version 27.0.

Version 28.0 at a Glance

AreaWhat is new
FormsCheck box, text, selection and date form fields, saved as TX, DOC, DOCX and RTF and exported as PDF form fields
Conditional instructionsRules that enable, validate or fill form fields depending on the values of other fields
Document targetsBookmarks at any position, several at one position, DocumentTarget no longer derived from TextField
Dialog boxesThe measuring unit of the editor's dialog boxes
Document EditorMost of the .NET object model in the JavaScript API, reconnection after short connection losses

Form Fields

Four new kinds of text fields let you design forms and let users fill them out. ServerTextControl.FormFields returns the FormFieldCollection of the main text; headers, footers and text frames have their own. See Form Fields for the .NET API and Form Fields for the Document Editor.

  • Check boxes. A CheckFormField is checked or unchecked by the user. Its text can't be edited; it is the Unicode character for the checked or the unchecked state, set with CheckedCharacter and UncheckedCharacter.
  • Text fields. A TextFormField is a text input field. EmptyWidth sets its width while it is empty.
  • Selection fields. A SelectionFormField is a combo box or a drop-down list, depending on whether its text can be changed. Items holds the entries.
  • Date fields. A DateFormField holds a date that the user selects in a date control or types. DateFormat formats it.
  • Enabled state. FormField.Enabled switches a form field on or off.
  • Events. The editor raises FormFieldCheckChanged, FormFieldDateChanged, FormFieldSelectionChanged and FormFieldTextChanged when a user changes a form field.
  • Filling forms in protected documents. DocumentPermissions.AllowEditingFormFields keeps form fields editable when the edit mode has been changed from Edit to ReadAndSelect.
  • File formats. Form fields are saved and loaded with the TX Text Control format, DOC, DOCX and RTF. A document saved as PDF contains them as PDF form fields. A form field of MS Word becomes a form field or an application field, depending on LoadSettings.ApplicationFieldFormat.
  • Rendering in the editor. On the server side of the editor, DrawCombobox and DrawDateControl occur when the combo box of a selection field or the date control of a date field has to be drawn, CanEditFormFields tells whether form fields can be edited, and TextViewGenerator.Colors.FormFieldColor sets the color of form fields.

Conditional Instructions

Conditional instructions are a rule engine for forms. A ConditionalInstruction holds a list of Instruction objects that are executed when all of its Condition objects are met. FormFieldCollection.ConditionalInstructions returns the ConditionalInstructionCollection of a document.

  • Conditions. A condition is met when the value of its form field compares successfully with a required value.
  • Instructions. An instruction does one of four things to a form field: it changes FormField.Enabled, marks the value as valid or invalid, sets a new value or replaces the Items of a selection field.
  • Else values. An instruction can have an else value, which is applied when the conditions aren't met.
  • User interface. Users of the editor manage the instructions in a dialog box and in the Conditional Instructions sidebar.

See Conditional Instructions.

Document Targets and Bookmarks

A DocumentTarget is a bookmark: a position in the document that a link can point to.

  • Any position. A document target can be inserted at any text position, including inside a text field and at its beginning or end, and several targets can share one position. Users of the editor can insert several bookmarks at the same position as well.
  • No longer a text field. To make this possible, DocumentTarget no longer inherits from TextField. Members it used to inherit, such as the ID and ScrollTo, are now implemented by DocumentTarget itself, and inherited members that had no meaning for a target, such as Text and Editable, are gone.
  • Events. DocumentTargetCreated and DocumentTargetDeleted of ServerTextControl pass a DocumentTargetEventArgs object. DocumentTargetCollection.GetItems is also new.
  • Text field events. TextFieldCreated and TextFieldDeleted of ServerTextControl occur when a text field is created or deleted.

Dialog Boxes

TextViewGenerator.DialogUnit sets the measuring unit of sizes and distances in the dialog boxes of the editor. With Auto, the unit depends on the culture of the current thread; Centimeter, Inch and Millimeter set it explicitly. A TextViewGenerator is the ServerTextControl that renders the editor's text as a generated image on the server.

Document Editor

  • JavaScript API. Most of the .NET programming interface became available in the browser: collections, frames, tables, sections, styles, fields, form fields, tracked changes and more. Because web programming is asynchronous, most properties are get and set methods that take callback functions, which receive the value or an error. The existing JavaScript API didn't change, so existing code keeps working. The TXTextControl object is the entry point. See JavaScript API.
  • Reconnection. After a short loss of the connection, for example on a mobile network with poor coverage, the editor tries to reconnect to the server for some time instead of ending the session. DocumentEditorSettings.reconnectTimeout of today's editor sets that time; see WebSockets.

Upgrade to Version 28.0

  • DocumentTarget no longer inherits from TextField. Code that treats a DocumentTarget as a TextField, casts it to one or calls a member that only TextField has, such as Text or Editable, doesn't compile against version 28.0. Use the members of DocumentTarget itself, such as TargetName.
  • TextFieldType.DocumentTarget removed. The value DocumentTarget of the TextFieldType enumeration was removed. Code that passes it, for example to GetTextFields, has to change; the targets of the main text are in ServerTextControl.DocumentTargets.
  • Update notes. TextFieldType was extended with CheckFormField, DateFormField, SelectionFormField, TextFormField and FormFields. LoadSettings.ApplicationFieldFormat accepts the new value MSWordTXFormFields of ApplicationFieldFormat, which loads the form fields of MS Word as form fields of TX Text Control.

New Classes, Properties, Methods and Events

These are the classes and members that the What's New documentation of version 28.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. The Document Editor's JavaScript API alone gained more than 700 methods.

New Classes

.NET Members by Class

ClassPropertiesMethodsEvents
ApplicationFieldCollectionItem
CheckFormFieldChecked, CheckedCharacter, SupportedCheckedCharacters, SupportedUncheckedCharacters, UncheckedCharacter
CheckFormFieldEventArgsCheckFormField
ConditionComparisonOperator, ComparisonValue, ComparisonValueType, FormField, LogicalConnective
ConditionalInstructionConditions, Instructions, NameCopy
ConditionalInstructionCollectionConditionalInstructionNames, CountAdd, Clear, CopyTo, GetEnumerator, GetItem, GetItems, IsValueValid, Remove
DateFormFieldDate, DateFormat, EmptyWidth, IsDateControlVisible, SupportedDateFormats
DateFormFieldEventArgsDateFormField
DocumentLinkCollectionItem
DocumentPermissionsAllowEditingFormFields
DocumentTargetCollectionItemGetItems
DocumentTargetEventArgsDocumentTarget
FormFieldEnabled
FormFieldCollectionConditionalInstructions, ItemAdd, Clear, CopyTo, GetItem, Remove
HeaderFooterFormFields
HypertextLinkCollectionItem
IFormattedTextFormFields
InstructionElseInstructionValue, FormField, InstructionType, InstructionValue, IsElseInstructionEnabled, IsFormFieldChangeInstruction, IsInitialInstruction
PageNumberFieldCollectionItem
SelectionFormFieldEmptyWidth, IsDropDownArrowVisible, Items, SelectedIndex
SelectionFormFieldEventArgsSelectionFormField
ServerTextControlFormFieldsOnDocumentTargetCreated, OnDocumentTargetDeleted, OnTextFieldCreated, OnTextFieldDeletedDocumentTargetCreated, DocumentTargetDeleted, TextFieldCreated, TextFieldDeleted
ServerVisualization.DrawComboboxEventArgsBold, FontName, FontSize, Italic, Location, SelectionFormField, Size
ServerVisualization.DrawDateControlEventArgsDateFormField, Location
ServerVisualization.TextViewGeneratorCanEditFormFields, DialogUnit, IsFormFieldValidationEnabledOnDrawCombobox, OnDrawDateControl, OnFormFieldCheckChanged, OnFormFieldDateChanged, OnFormFieldSelectionChanged, OnFormFieldTextChanged, OnRemoveCombobox, OnRemoveDateControlDrawCombobox, DrawDateControl, FormFieldCheckChanged, FormFieldDateChanged, FormFieldSelectionChanged, FormFieldTextChanged, RemoveCombobox, RemoveDateControl
ServerVisualization.TextViewGenerator.ColorsActiveFormFieldColor, FormFieldColorResetActiveFormFieldColor, ResetFormFieldColor
TextFieldCollectionItem
TextFormFieldEmptyWidth
TextFormFieldEventArgsTextFormField
TextFrameFormFields

Document Editor JavaScript API

ObjectPropertiesMethods
ApplicationFieldgetFormat, getParameters, getTypeName, setFormat, setParameters, setTypeName
ApplicationFieldCollectionadd, getItem, remove
BarcodegetAdditionalText, getAlignment, getAngle, getBackColor, getBarcodeType, getForeColor, getShowText, getText, getTextAlignment, getUpperTextLength, saveImage, setAdditionalText, setAlignment, setAngle, setBackColor, setBarcodeType, setForeColor, setShowText, setText, setTextAlignment, setUpperTextLength
BarcodeCollectionaddAnchored, addAnchoredAtLocation, addAtFixedPositionInDocument, addAtFixedPositionOnPage, addInline, addWithMouse, getItem, getItemByName, remove
BarcodeEventArgsbarcodeFrame
BarcodeFramebarcoderefresh
BarcodeTypeSettingsgetHasCheckValue, getShowCheckValue, setHasCheckValue, setShowCheckValue
ChartEventArgschartFrame
CheckFormFieldgetChecked, getCheckedCharacter, getUncheckedCharacter, setChecked, setCheckedCharacter, setUncheckedCharacter
CollectionelementAt, forEach, getCount
DateFormFieldgetDate, getDateFormat, getEmptyWidth, getSupportedDateFormats, setDate, setDateFormat, setEmptyWidth
Distancesbottom, left, right, top
DocumentLinkgetDocumentTarget, setDocumentTarget
DocumentLinkCollectionadd, clear, getItem, remove
DocumentLinkEventArgstarget
DocumentTargetgetDeleteable, getID, getName, getNumber, getStart, getTargetName, scrollTo, setDeleteable, setID, setName, setTargetName
DocumentTargetCollectionadd, clear, getCanAdd, getItem, remove
DocumentTargetInfotargetName
DrawingEventArgsdrawingFrame
EditableRegiongetHighlightColor, getHighlightMode, getID, getLength, getStart, getText, getUserName, save, scrollTo, setHighlightColor, setHighlightMode, setID, setUserName
EditableRegionCollectionadd, getItems, remove
EditableRegionEventArgsid, length, start, userName
FormattedTextapplicationFields, documentLinks, documentTargets, editableRegions, frames, hypertextLinks, lines, misspelledWords, paragraphs, selection, subTextParts, tables, textChars, textFields, textPartType, trackedChangesfind
FormattingStyleapply, getBaseline, getBaseStyle, getBold, getFontName, getFontSize, getForeColor, getItalic, getName, getStrikeout, getTextBackColor, getUnderline, setBaseline, setBold, setFontName, setFontSize, setForeColor, setItalic, setName, setStrikeout, setTextBackColor, setUnderline
FormattingStyleCollectionremove
FormFieldCollectionaddCheckFormField, addDateFormField, addSelectionFormField, addTextFormField, getItem, remove
FrameBasechangeZOrder, getAlignment, getBounds, getID, getInsertionMode, getLocation, getMoveable, getName, getSize, getSizeable, getTextDistances, getTextPosition, setAlignment, setID, setInsertionMode, setLocation, setMoveable, setName, setSize, setSizeable, setTextDistances
FrameBaseCollectionclear
FrameCollectiongetItem, getItemByName, remove
FrameEventArgsframe
FrameInfoid, location, name, textPosition
HeaderFooteractivate, deactivate, getConnectedToPrevious, getDistance, getType, setConnectedToPrevious, setDistance
HeaderFooterCollectionadd, getItem, remove
HeaderFooterEventArgsconnectedToPrevious, distance, type
HyperLinkInfotarget
HypertextLinkgetTarget, setTarget
HypertextLinkCollectionadd, getItem, remove
HypertextLinkEventArgshypertextLink
HyphenateWordEventArgsdividePos, maxDividePos, word
ImagegetHorizontalScaling, getVerticalScaling, setHorizontalScaling, setVerticalScaling
ImageCollectionaddAnchored, addAnchoredAtLocation, addAtFixedPosition (obsolete), addAtFixedPositionInDocument, addAtFixedPositionOnPage, addInline, getItem, getItemByName, remove
ImageEventArgsimage
InlineStyleisInheritedFromParagraph, resetToParagraph
InlineStyleCollectionadd, getItem
InputFormataddEventListener, getAllFrameLines, getBold, getBottomAligned, getBottomDistance, getBoxFrame, getBulletCharacter, getBulletedList, getCentered, getFontFamily, getFontSize, getFrameFillColor, getFrameLineColor, getFrameLineWidth, getHangingIndent, getInnerHorizontalFrameLines, getInnerVerticalFrameLines, getItalic, getJustified, getLeftAligned, getLeftFrameLine, getLeftIndent, getLeftToRight, getLinespacing, getNumberedList, getNumberedListFormat, getNumberFormats, getRightAligned, getRightFrameLine, getRightIndent, getRightToLeft, getStrikeout, getStructuredList, getStructuredListFormat, getStyleName, getStyleNames, getSubscript, getSuperscript, getSupportedFontFamilies, getSupportedFontSizes, getSupportedUnderlineStyles, getTextBackColor, getTextColor, getTopAligned, getTopDistance, getTopFrameLine, getUnderline, getUnderlineStyle, getVerticallyCentered, removeEventListener, setAllFrameLines, setBold, setBottomAligned, setBottomDistance, setBoxFrame, setBulletCharacter, setBulletedList, setCentered, setFontFamily, setFontSize, setFrameFillColor, setFrameLineColor, setFrameLineWidth, setHangingIndent, setInnerHorizontalFrameLines, setInnerVerticalFrameLines, setItalic, setJustified, setLeftAligned, setLeftFrameLine, setLeftIndent, setLeftToRight, setLinespacing, setNumberedList, setNumberedListFormat, setRightAligned, setRightFrameLine, setRightIndent, setRightToLeft, setStrikeout, setStructuredList, setStructuredListFormat, setStyleName, setSubscript, setSuperscript, setTextBackColor, setTextColor, setTopAligned, setTopDistance, setTopFrameLine, setUnderline, setUnderlineStyle, setVerticallyCentered
InputPositiongetCaretSize, getColumn, getInactiveMarker, getLine, getLocation, getPage, getPageInSection, getSection, getTextPosition, scrollTo, setInactiveMarker
LinegetBaseline, getLength, getNumber, getPage, getStart, getText, getTextBounds, save
LineCollectiongetItem, getItemAtLocation
ListFormatgetBulletCharacter, getBulletSize, getFirstNumber, getFontName, getFormatCharacter, getHangingIndent, getLeftIndent, getLevel, getNumberFormat, getRestartNumbering, getTextAfterNumber, getTextBeforeNumber, getType, setBulletCharacter, setBulletSize, setFirstNumber, setFontName, setFormatCharacter, setHangingIndent, setLeftIndent, setLevel, setNumberFormat, setRestartNumbering, setTextAfterNumber, setTextBeforeNumber, setType
MisspelledWordgetIsDuplicate, getIsIgnored, getLength, getNumber, getStart, getText, select, setIsDuplicate, setIsIgnored
MisspelledWordCollectiongetCountOf, getItemAtInputPosition, getItemAtLocation, getItemAtTextPosition, ignore, remove
MisspelledWordInfoisDuplicate, isIgnored, length, number, start, text
PagegetBounds, getFooter, getHeader, getImage, getLength, getNumber, getNumberInSection, getSection, getStart, getTextBounds, select
PageCollectiongetItem, getItemAtTextPosition
Paragraphformat, listFormatgetFormattingStyle, getLength, getLines, getListNumber, getListNumberText, getStart, getStartLine, getText, save, select, setFormattingStyle
ParagraphCollectiongetItem, getItemAtLocation
ParagraphFormatsetFrameLineColor
ParagraphStylelistFormat, paragraphFormatgetFollowingStyle, getParagraphFormat, setFollowingStyle
ParagraphStyleCollectionadd, getItem
PropertyChangedEventArgsnewValue
Sectionformat, headersAndFootersgetLength, getNumber, getStart, select
SectionCollectionadd, addAtTextPosition, getItem
SelectionFormFieldgetEmptyWidth, getIsDropDownArrowVisible, getItems, getSelectedIndex, setEmptyWidth, setIsDropDownArrowVisible, setItems, setSelectedIndex
SpellCheckTextEventArgsmisspelledWords, text
SubTextPartgetData, getHighlightColor, getHighlightMode, getID, getLength, getName, getNestedLevel, getNumber, getOuterMostSubTextPart, getOuterSubTextPart, getStart, getText, save, scrollTo, setData, setHighlightColor, setHighlightMode, setID, setName
SubTextPartCollectionadd, clear, getItem, remove
Tablecells, columns, nestedTables, rowsgetCanMergeCells, getCanSplit, getCanSplitCells, getID, getNestedLevel, getOuterMostTable, getOuterTable, mergeCells, select, selectCells, setID, split, splitCells
TableBaseCollectiongetItem, removeAtInputPosition, removeById
TableCellgetCellFormat, getColumn, getFormula, getLength, getName, getPosition, getRow, getStart, getText, getWidth, select, setFormula, setName, setPosition, setText, setWidth
TableCellBordergetColor, getTextDistance, getWidth, setColor, setTextDistance, setWidth
TableCellCollectiongetCanRemove, getItem, getItemAtInputPosition, remove
TableCellFormatbottomBorder, leftBorder, rightBorder, topBordergetBackColor, getNumberFormat, getTextType, getVerticalAlignment, setBackColor, setNumberFormat, setTextType, setVerticalAlignment
TableCollectionadd, getCanAdd, getGridLines, getItem, setGridLines
TableColumngetCellFormat, getColumn, getPosition, getWidth, select, setPosition, setWidth
TableColumnCollectionadd, getCanAdd, getCanRemove, getItem, remove
TableEventArgstable
TableInfoid, nestedLevel
TableRowgetAllowPageBreak, getCellFormat, getIsHeader, getMinimumHeight, getRow, select, setAllowPageBreak, setIsHeader, setMinimumHeight
TableRowCollectionadd, getCanAdd, getCanRemove, getItem, remove
TextChargetBounds, getChar, getNumber
TextCharCollectionadd, addControlChar, getItem, remove
TextFieldgetBounds, getContainsInputPosition, getDeleteable, getDoubledInputPosition, getEditable, getFormattingBounds, getHighlightColor, getHighlightMode, getID, getIsSpellCheckingEnabled, getLength, getName, getStart, getText, scrollTo, setDeleteable, setDoubledInputPosition, setEditable, setHighlightColor, setHighlightMode, setID, setIsSpellCheckingEnabled, setName, setText
TextFieldCollectionadd, clear, getItem, remove
TextFieldCollectionBasegetCanAdd
TextFormFieldgetEmptyWidth, setEmptyWidth
TextFrameactivate, changeZOrder, getAlignment, getBackColor, getBorderWidth, getBounds, getID, getInsertionMode, getInternalMargins, getLocation, getMoveable, getName, getSize, getSizeable, getTextDistances, getTextPosition, getTransparency, setAlignment, setBackColor, setBorderWidth, setID, setInsertionMode, setInternalMargins, setLocation, setMoveable, setName, setSize, setSizeable, setTextDistances, setTransparency
TextFrameCollectionaddAnchored, addAnchoredAtLocation, addAtFixedPositionInDocument, addAtFixedPositionOnPage, addInline, addWithMouse, getItem, getItemByName, remove
TextFrameEventArgstextFrame
TextPartCollectionactivate, getItem, getMainText
TextViewGeneratorColorsgetActiveFormFieldColor, getDarkShadowColor, getDesktopColor, getFormFieldColor, getHeaderFooterLabelColor, getHeaderFooterLineColor, getLightShadowColor, resetDarkShadowColor, resetDesktopColor, resetHeaderFooterLabelColor, resetHeaderFooterLineColor, resetLightShadowColor, setActiveFormFieldColor, setDarkShadowColor, setDesktopColor, setFormFieldColor, setHeaderFooterLabelColor, setHeaderFooterLineColor, setLightShadowColor
TrackedChangegetActive, getChangeKind, getChangeTime, getHighlightColor, getHighlightMode, getLength, getNumber, getStart, getText, getUserName, save, setActive, setHighlightColor, setHighlightMode
TrackedChangeCollectiongetItem, remove
TrackedChangeEventArgstrackedChange
TrackedChangeInfochangeKind, changeTime, highlightColor, highlightMode, length, number, start, userName
TXTextControlbarcodes, barcodeTypeSettings, displayColors, headersAndFooters, inlineStyles, inputFormat, inputPosition, listFormat, pageMargins, pages, pageSize, paragraphFormat, paragraphStyles, sections, textPartsaddEventListener, clear, clearUndo, focus, getActivationState, getAllowUndo, getBackColor, getBaseline, getCanCharacterFormat, getCanCopy, getCanDocumentFormat, getCanPaste, getCanPrint, getCanRedo, getCanStyleFormat, getCanTableFormat, getCanUndo, getControlChars, getDocumentTargetMarkers, getDrawingMarkerLines, getEditMode, getFontUnderlineStyle, getForeColor, getFormulaReferenceStyle, getIsFormulaCalculationEnabled, getIsHyphenationEnabled, getIsLanguageDetectionEnabled, getIsSpellCheckingEnabled, getIsTrackChangesEnabled, getLandscape, getPageCount, getPageUnit, getPermanentControlChars, getRedoActionName, getSelectObjects, getSupportedFonts, getSupportedPaperSizes, getText, getTextBackColor, getTextFrameMarkerLines, getUndoActionName, getUserNames, getViewMode, load, redo, removeEventListener, resetContents, save, select, selectAll, selectWord, setActivationState, setAllowUndo, setBackColor, setBaseline, setControlChars, setDocumentTargetMarkers, setDrawingMarkerLines, setEditMode, setFontUnderlineStyle, setForeColor, setFormulaReferenceStyle, setIsFormulaCalculationEnabled, setIsHyphenationEnabled, setIsLanguageDetectionEnabled, setIsSpellCheckingEnabled, setIsTrackChangesEnabled, setLandscape, setPageUnit, setPermanentControlChars, setSelectObjects, setText, setTextBackColor, setTextFrameMarkerLines, setViewMode, showHorizontalRuler, showRibbonBar, showStatusBar, showVerticalRuler, undo, zoom
LoadSettingsaddParagraph, applicationFieldFormat, applicationFieldTypeNames, documentAccessPermissions, documentBasePath, documentPartName, imageSearchPath, loadDocumentBackColor, loadHypertextLinks, loadImages, loadSubTextParts, masterPassword, PDFImportSettings, reportingMergeBlockFormat, userPassword
SaveSettingsauthor, creationDate, creatorApplication, cssSaveMode, documentAccessPermissions, documentKeywords, documentLevelJavaScriptActions, documentSubject, documentTitle, flattenFormFields, imageCompressionQuality, imageExportFilterIndex, imageMaxResolution, lastModificationDate, masterPassword, omittedContent, reportingMergeBlockFormat, saveDocumentBackColor, userPassword

Next Steps

  • Version 29.0: the features of the next version.
  • Version 27.0: the features of the previous version.
  • Older Versions: all versions from 29.0 back to 10.1.
  • TX Text Control X18 has been Released: the release announcement on the Text Control Blog.