DS Server

.NET API

Topic

C# code works with DS Server through three NuGet packages. Two of them run in your application and call the Web API: TXTextControl.DocumentServices.DocumentProcessing for documents and TXTextControl.DocumentServices.Admin for the administration of the server. The third, TXTextControl.DocumentServices.Plugin.Abstractions, is used by plugins, assemblies that DS Server loads to add endpoints and services of its own.

The navigation lists a page for each package with the README or description it is published with on nuget.org. The tables below name the namespaces of each package and their main classes, so that you know which package and using directive a class needs.

Packages

PackageVersionTarget frameworksUsed by
TXTextControl.DocumentServices.DocumentProcessing5.0.0.NET 8, .NET 10Your application: converts, merges and creates documents through the DocumentProcessing Web API
TXTextControl.DocumentServices.Admin5.0.0.NET 8, .NET 10Your application: manages security profiles, OAuth and authentication servers through the administration Web API
TXTextControl.DocumentServices.Plugin.Abstractions5.0.1.NET 8, .NET 10A plugin: the plugin interface and the services DS Server passes to it

The packages for the Document Editor and the Document Viewer in ASP.NET Core views, TXTextControl.DocumentServices.DocumentEditor and TXTextControl.DocumentServices.DocumentViewer, are described with their settings in ASP.NET Core.

TXTextControl.DocumentServices.DocumentProcessing

NamespaceMain typesWhat they do
TXTextControl.DocumentServices.DocumentProcessingDocumentProcessingSends requests to the DocumentProcessing Web API: Convert, Merge, Append, FindAndReplace, Thumbnails, Info and InstalledPrinters, below PDF the methods Create, GetEmbeddedFiles, GetMetaData and AcroForms.GetFields, and below Barcodes the methods Create, GetDefaultText, GetMinimumTextLength, GetMaximumTextLength and IsTextValid
MergeBody, MergeSettings, AppendBody, AppendDocument, FindAndReplaceBody, DocumentSettingsThe request data of merge, append and find and replace, and the document properties
DocumentInfo, MergeField, MergeBlock, PrinterInfoThe information that Info and InstalledPrinters return
ReturnFormat, ImageFormat, DocumentDivider, FormFieldMergeTypeEnumerations of the formats and options
ServiceRequestExceptionThrown when a request fails; StatusCode holds the HTTP status code
TXTextControl.DocumentServices.DocumentProcessing.PDFPDFSettings, DigitalSignature, EmbeddedFilePDF settings, the certificate for a digital signature and the files that PDF.GetEmbeddedFiles returns
PDFFormat, DocumentAccessPermissionsEnumerations of the PDF options
TXTextControl.DocumentServices.DocumentProcessing.PDF.AcroFormsFormFieldThe base class of the form fields that PDF.AcroForms.GetFields returns
TXTextControl.DocumentServices.DocumentProcessing.BarcodesBarcodeSettings, BarcodeType, BarcodeImageFormatThe content and appearance of a barcode, and the enumerations of the barcode types and image formats
TXTextControl.DocumentServices.DocumentProcessing.OAuthOAuthSettingsThe client ID, client secret and redirect URI of the security profile

Each method corresponds to an endpoint of the DocumentProcessing Web API, whose page describes the parameters and the result. ASP.NET Core maps the methods to the endpoints and shows the package in a controller.

TXTextControl.DocumentServices.Admin

NamespaceMain typesWhat they do
TXTextControl.DocumentServices.AdminAdminConnects with the URL of DS Server and the admin password, and adds, reads, changes and deletes security profiles, switches OAuth, manages authentication servers and changes passwords
SecurityProfile, ClientCredentialsA security profile with its name, expiry date and grant type setting, and its client ID, secret and authorized redirect URIs
AuthenticationServerAn authentication server with its ID, name and URL
ServiceRequestExceptionThrown when a request fails; StatusCode holds the HTTP status code

The methods call the Administration endpoints of the Web API. ASP.NET Core lists them.

TXTextControl.DocumentServices.Plugin.Abstractions

This package holds more than the plugin interface: it also defines the services that DS Server 5.0 and later passes to a plugin by dependency injection, with their own namespaces.

NamespaceMain typesWhat they do
TXTextControl.DocumentServices.Plugin.AbstractionsIPlugin, PluginContextThe interface every plugin implements, with ConfigureServices, ConfigureMiddleware, OnStart and OnStop, and the context that gives a plugin the DS Server version, the base directory of the DS Server installation and the configuration
TXTextControl.DocumentServices.DocumentProcessing.AbstractionsIDocumentProcessingService, IPdfApi, IAcroFormsApi, IBarcodesApiDocument processing inside DS Server: MergeAsync, ConvertAsync, AppendAsync, FindAndReplaceAsync, GetThumbnailsAsync, GetDocumentInfoAsync, and the PDF, AcroForms and barcode APIs
TXTextControl.DocumentServices.DocumentProcessing.ModelsMergeBody, MergeSettings, BarcodeSettings, FormField, ReturnFormatThe data and enumerations of IDocumentProcessingService
TXTextControl.DocumentServices.DocumentEditor.AbstractionsIDocumentEditorSessionService, IDocumentEditorSession, ISelection, IParagraphFormatAccess to the open Document Editor sessions and to the document in each
TXTextControl.DocumentServices.DocumentEditor.OptionsLoadOptions, SaveOptionsOptions for loading a document into a session and saving it
TXTextControl.DocumentServices.DocumentEditor.EnumsDocumentFormat, EditMode, TextFieldTypeEnumerations of the editor session API

Some type names, such as MergeBody and ReturnFormat, exist both in the DocumentProcessing client package and in the plugin package, in different namespaces. A plugin uses the types of TXTextControl.DocumentServices.DocumentProcessing.Models; an application that calls the Web API uses those of the client package. Plugins explains how a plugin is built and deployed.

Pages in This Section