What's New in TX Text Control .NET Server 29.0
Tables of contents, files embedded in PDF documents and the DocumentSettings class arrived in TX Text Control .NET Server with version 29.0. The version also added the DocumentServer.PDF namespace, which reads AcroForm fields and searches the text of PDF documents, and it made barcodes part of TX Text Control itself.
Version 29.0 was released on December 2, 2020, as TX Text Control X19, together with TX Text Control .NET for Windows Forms, TX Text Control .NET for WPF, TX Text Control ActiveX and TX Spell .NET 8.0. Its last full installer, that of Service Pack 3, is dated July 21, 2021. The features below are the ones added since version 28.0; the next version is Version 30.0.
Version 29.0 at a Glance
| Area | What is new |
|---|---|
| Document structure | Tables of contents generated from structure levels, document settings such as author and title |
| Embedded files, AcroForm import, text search in PDF documents | |
| Mail merge | Filters and sorting instructions of existing merge blocks changed in code |
| Barcodes | TX Barcode .NET integrated into TX Text Control |
| Document Editor | Rendering at the display scale of the device, JavaScript API for tables of contents, embedded files and document settings |
| Document Viewer | JavaScript API for annotations and form field values |
Tables of Contents
A table of contents is generated from the structure level of the paragraphs in a document. See Tables of Contents for the .NET API and Tables of Contents for the Document Editor.
- Structure levels. ParagraphFormat.StructureLevel sets the level of a paragraph, from 0 to 10. Level 0 means that the paragraph belongs to the body of the document. The level is usually part of a ParagraphStyle rather than set per paragraph.
- Adding a table of contents. Create a TableOfContents object and add it with TableOfContentsCollection.Add. The collection of the main text is ServerTextControl.TablesOfContents; headers, footers and text frames have their own. The table is inserted at the current input position, with or without page numbers.
- What it contains. MinimumStructureLevel and MaximumStructureLevel select the paragraphs, and Title and HasPageNumbers set its title and page numbers. A document can hold several tables of contents with different levels.
- Styles. TX Text Control creates a formatting style for the title and each level, named
TOC_Title,TOC_Level1,TOC_Level2and so on, so that the appearance can be changed through the styles. - Links. With HasLinks, each entry becomes a document link with a matching document target. In the editor, a click with the CTRL key held down scrolls to the entry's page. DocumentLink.AutoGenerationType tells whether a link was created this way.
- Updates and events. TableOfContents.Update regenerates the entries. TableOfContentsCreated and TableOfContentsDeleted occur on
ServerTextControl, and TableOfContentsEntered andTableOfContentsLeftin the editor. - Tab leaders. ParagraphFormat.TabLeaders, also new, sets the characters that fill the space before a tab position, such as the dots before a page number.
PDF Documents
Version 29.0 extended both directions of the PDF support: files can be embedded when a PDF is saved, and a new namespace reads data out of existing PDF documents.
- Embedded files. EmbeddedFile holds a file and its data, with optional properties such as the MIME type, the relationship, a description and dates. LoadSaveSettingsBase.EmbeddedFiles, available as
SaveSettings.EmbeddedFilesandLoadSettings.EmbeddedFiles, embeds files when a PDF is saved and returns them when a PDF is loaded. To load them, LoadSettings.PDFImportSettings has to includeLoadEmbeddedFiles. See Attachments. - AcroForm import. DocumentServer.PDF.Forms.GetAcroFormFields returns the form fields of a PDF document as AcroForms.FormField objects: text fields, check boxes, choice fields, combo boxes, list boxes, radio buttons and buttons. Its typical use is reading the values of a form that users filled out. See AcroForms.
- Text search. DocumentServer.PDF.Contents.Lines.Find searches the lines of a PDF document for a string, a regular expression or a geometric position and returns ContentLine objects with the text, the page and the position of each line. See Text Extraction.
Document Settings
ServerTextControl.DocumentSettings returns a DocumentSettings object with the general settings of the current document: author, creation date, creator application, base path, keywords, subject, title, embedded files and user-defined properties. The values can be changed while the document is open. Save stores them with the document, and a property of SaveSettings with the same name overrides a value for one save. See Document Properties and Document Metadata.
Mail Merge
MailMerge creates documents from a template and data. Its repeating merge blocks, sections of the template that are repeated for each record, carry filter and sorting information since version 26.0, and version 29.0 made that information editable in code.
- MergeBlockInfo from an existing block. A new MergeBlockInfo constructor creates the object from a merge block of a template, a SubTextPart. The object then contains the block's Filters, SortingInstructions, merge fields, child blocks and the name of its data table.
- Write it back. After the information is changed, MergeBlockInfo.Apply stores it in the document.
Sorting and Filtering describes filters and sorting instructions.
Subtext Parts
SubTextPart.GetChildren returns the subtext parts nested in a subtext part, and SubTextPart.GetTextFields the text fields it contains. See Subtext Parts.
Barcodes
The barcode component TX Barcode .NET became part of TX Text Control, so barcodes no longer need a separate product. A barcode is a BarcodeFrame in a BarcodeCollection, positioned like an image or a text frame. The new Barcode.BarcodeTypeSettings class sets whether a barcode has a check value and whether it shows it. See Charts and Barcodes.
Document Editor
- Display scale. The Document Editor renders the text area, the rulers, the status bar and all modal dialog boxes in the resolution of the device the browser runs on, for display scale factors above 96 DPI. On the server side,
Resolutionproperties of the view generators, such as TextViewGenerator.Resolution, belong to this change. - JavaScript API. TXTextControl.documentSettings returns the DocumentSettings object with the document settings and an EmbeddedFileCollection. FormattedText.tablesOfContents returns a TableOfContentsCollection, and paragraph formats received get and set methods for the structure level and the tab leaders. refreshLayout is also new.
- Editor events. The editor's server side raises ShowErrorMessage and events when formatting styles change and when the input position moves to another paragraph.
Document Viewer
The Document Viewer received the annotations object in its JavaScript API, which loads, exports and shows annotations and sets the list of stamps. Two new methods of the forms object read the values of the form fields and validate them, and TXDocumentViewer.addEventListener attaches event handlers.
Upgrade to Version 29.0
- Update notes. The update notes of version 29.0 list one entry: LoadSettings.PDFImportSettings was extended with the settings
LoadEmbeddedFiles,LoadMetadataandGenerateXMLAsEmbeddedFile. Of the three, onlyLoadEmbeddedFilesis a value of the current PDFImportSettings enumeration. Today, the metadata, the form fields and the text coordinates of a PDF document come fromLoadEmbeddedDataand LoadSettings.EmbeddedData. The What's New documentation of version 30.0 repeats the same entry. - Breaking changes. No change of version 29.0 is known to break existing code. 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 29.0 lists for TX Text Control .NET Server. .NET names are relative to the TXTextControl namespace. Each name links to its current reference page.
New Classes
- Barcode.BarcodeTypeSettings
- DocumentLink
- DocumentServer.PDF.AcroForms.FormButton
- DocumentServer.PDF.AcroForms.FormCheckBox
- DocumentServer.PDF.AcroForms.FormChoiceField
- DocumentServer.PDF.AcroForms.FormComboBox
- DocumentServer.PDF.AcroForms.FormField
- DocumentServer.PDF.AcroForms.FormListBox
- DocumentServer.PDF.AcroForms.FormRadioButton
- DocumentServer.PDF.AcroForms.FormTextField
- DocumentServer.PDF.Contents.ContentLine
- DocumentServer.PDF.Contents.Lines
- DocumentServer.PDF.Forms
- DocumentSettings
- DocumentTarget
- EmbeddedFile
- TableOfContents
- TableOfContentsCollection
- TableOfContentsEventArgs
.NET Members by Class
Document Editor JavaScript API
Document Viewer JavaScript API
Next Steps
- Version 30.0: the features of the next version.
- Version 28.0: the features of the previous version.
- Older Versions: all versions from 29.0 back to 10.1.
- TX Text Control X19 and TX Spell 8.0 Have Been Released: the release announcement on the Text Control Blog.