Products Technologies Demo Docs Blog Support Company

Using TX Text Control in ASP.NET Core 3.0 Web Applications

This article shows how to use TX Text Control .NET Server (ServerTextControl) in .NET Core 3.0 ASP.NET web applications.

Using TX Text Control in ASP.NET Core 3.0 Web Applications

.NET Core 3.0 will be launched at .NET Conf, September 23-25th and the current version Preview 9 is the last preview before the final release. We tested our latest versions against this new framework and this article explains how to use TX Text Control .NET Server in an ASP.NET Core 3 Web Application.

In order to create a .NET Core 3 application, you will need to download the .NET Core 3.0 SDK:

Download .NET Core 3.0

Visual Studio 2019 doesn't provide .NET Core 3.0 as a selectable target. Visual Studio 2019 Preview is required to create .NET Core 3.0 applications:

Visual Studio 2019 Preview Release Notes

Why Is .NET 3.0 Supported and Not .NET 2.1?

Word processing is a complex task and requires some high-performance modules which are written in C++. Finally, the .NET Core 3.0 runtime added support for IJW C++/CLI on Windows that makes .NET Core 3.0 a usable target for TX Text Control applications running on Windows.

Additionally, the official package System.Drawing.Common from Microsoft provides access to GDI+ graphics functionality which is required in TX Text Control applications.

Creating the Application

The following tutorial shows how to create an ASP.NET Core 3 Web Application that can be deployed to Windows machines.

  1. In Visual Studio 2019 Preview, create a new project and select ASP.NET Core Web Application as the project template.

    Create a .NET Core 3 application

  2. Select a project name, location and solution name in the next dialog and confirm with Create.

  3. In the last dialog, select .NET Core and ASP.NET Core 3.0 as the project target, select Web Application (Model-View-Controller) as the template and confirm with Create.

    Create a .NET Core 3 application

  4. Open the Package Manager Console by choosing Package Manager Console from the Tools -> NuGet Package Manager main menu and type in the following command to install the System.Drawing.Common package:

    PM> Install-Package System.Drawing.Common
  5. While the project is selected in the Solution Explorer, choose Project -> Add Reference... to open the Reference Manager. In the opened dialog, select Browse... to select the required TX Text Control assemblies. Navigate to the installation folder of TX Text Control and select the following assemblies from the Assembly folder:

    • TXDocumentServer.dll
    • TXTextControl.dll
    • TXTextControl.Server.dll

    Create a .NET Core 3 application

    Repeat this step with the following assemblies from the Assembly/bin64 folder:

    • txic.dll
    • txkernel.dll
    • txtools.dll

    After selecting these assemblies, close the Reference Manager by confirming with OK.

  6. While the project is selected in the Solution Explorer, choose Project -> Add Existing Item.... Browse to the TX Text Control installation folder and select the following files from the Assembly/bin64:

    • tx27_xml.dll
    • tx27_css.dll
    • tx27_doc.dll
    • tx27_dox.dll
    • tx27_htm.dll
    • tx27_pdf.dll
    • tx27_rtf.dll
    • tx27_xlx.dll
  7. Select the files from step 6 in the Solution Explorer and set the Copy to Output Directory to Copy always.

  8. While the project is selected in the Solution Explorer, choose Project -> Add New Item.... Select Text File, name the file licenses.licx and close the dialog by clicking Add.

    Create a .NET Core 3 application

    Open the newly added file and add the following content:

    TXTextControl.ServerTextControl, TXTextControl.Server, Culture=neutral, PublicKeyToken=6b83fe9a75cfb638

    Set the Build Action property to Embedded Resource.

In case, you are getting compile errors (MSB6003 The specified task executable "lc.exe" could not be run.), please refer to this article:

LC Task in .NET Core Projects

Now, you can use ServerTextControl and MailMerge in your .NET Core 3 Web Application:

public IActionResult Index()
{
    using (TXTextControl.ServerTextControl tx = new TXTextControl.ServerTextControl())
    {
        tx.Create();
        // ...
    }

    return View();
}

Stay in the loop!

Subscribe to the newsletter to receive the latest updates.

ASP.NET

Integrate document processing into your applications to create documents such as PDFs and MS Word documents, including client-side document editing, viewing, and electronic signatures.

ASP.NET Core
Angular
Blazor
JavaScript
React
  • Angular
  • Blazor
  • React
  • JavaScript
  • ASP.NET MVC, ASP.NET Core, and WebForms

Learn more Trial token Download trial

Related Posts

ASP.NETDockerLinux

ASP.NET Core: Deploying the TX Text Control 32.0 SP2 Document Editor to Linux

To deploy the TX Text Control 32.0 SP2 Document Editor on Linux as part of an ASP.NET Core Web application, the synchronization service must be deployed separately on a Windows VM. This allows the…


ASP.NETDocument ViewerLinux

ASP.NET Core: Deploying the TX Text Control Document Viewer to Azure App…

Unlike the document editor, the document viewer doesn't require a TCP synchronization service to render the document. But it also requires a backend that runs on a Windows Server instance. This…


ASP.NETWindows FormsWPF

Visual Studio 2022 and .NET 5, 6 and 7 (Preview) Support and Strategy

With the release of TX Text Control 31.0, we will fully support .NET 5, 6 and 7 (Preview) within Visual Studio 2022 including Windows Forms designer support, NuGet packages and deployment support.


ASP.NET.NET 6.NET Core

2021 Wrap Up - Rethinking Documents

2021 was an exciting year for Text Control with new innovative products, features and technologies. This blog entry gives a quick overview of the last year and an outlook of what to expect in 2022.


ASP.NETDocument ViewerLinux

ASP.NET Core: Deploying the TX Text Control Document Viewer to Azure App…

Unlike the document editor, the document viewer doesn't require a TCP synchronization service to render the document. But it also requires a backend that runs on a Windows Server instance. This…