DS Server

Document Processing

Topic

DocumentProcessing is the Web API of DS Server that works on documents without a user interface: it converts them between formats, merges templates with JSON data, combines documents, renders page thumbnails and creates PDFs. The two tutorials below build the same first application, a conversion from HTML to PDF, in two ways, so you can start with the one that fits your stack.

Two Ways to Call DocumentProcessing

ASP.NET CoreWeb API
What you useThe NuGet package TXTextControl.DocumentServices.DocumentProcessingPlain HTTP requests, shown with curl and JavaScript
LanguagesC#, in any .NET 8 or .NET 10 applicationAny language with an HTTP client
Access tokenThe package requests it and sends it with every requestYou request it at /oauth/token and send it yourself
DocumentsByte arrays in and outBase64-encoded strings in JSON
TutorialASP.NET CoreWeb API

Both send the same requests to the same endpoints: the .NET package is a wrapper around the Web API. Everything the package does, you can do with HTTP requests, so the choice depends only on the language of your application.

What Both Tutorials Need

  • A DS Server of your own, installed and registered, or a Trial Token for the trial server that Text Control hosts. An unregistered server answers every DocumentProcessing request with DS Server is not registered.
  • A security profile with its client ID and client secret, which allows the client credentials grant type. ASP.NET Core shows how to create it in the admin portal. The trial token comes with such a profile.

Pages in This Section

  • ASP.NET Core: create an ASP.NET Core MVC application, install the NuGet package and return a PDF that DS Server converted from HTML.
  • Web API: request an access token and convert HTML to PDF with curl, then with JavaScript in Node.js.

The task pages of Document Processing go further, with one page each for converting, merging, appending, thumbnails, PDF documents and barcodes. The Web API reference describes every endpoint.