TX Text Control for Angular requires a backend for the document editor and viewer. This step-by-step walkthrough shows how to create the ASP.NET Core backend.
In order to create a backend application, TX Text Control .NET Server for ASP.NET must be installed on your machine. When deploying this backend application, refer to the documentation to learn how to install the required TCP Service:
Creating the Project
The following tutorial shows how to create an ASP.NET Core 3 Web Application that can be deployed to Windows machines.
In Visual Studio 2019 (> 16.5.4), create a new project, select ASP.NET Core Web Application as the project template and continue with Next.
Select a project name, location and solution name in the next dialog and confirm with Create.
In the last dialog, select .NET Core and ASP.NET Core 3.1 as the project target, select Empty as the template and confirm with Create.
Adding TX Text Control Assemblies
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:
Repeat this step with the following assemblies from the Assembly/bin64 folder:
After selecting these assemblies, close the Reference Manager by confirming with OK.
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:
Select the files from step 5 in the Solution Explorer and set the Copy to Output Directory to Copy always.
Adding the License
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.
Open the newly added file and add the following content:
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:
Text Control Middleware Packages
The middleware is contained in the NuGet packages that also include the editor and viewer components for ASP.NET Core.
Select NuGet Package Manager -> Package Manager Console from the Tools main menu.
Type and execute the following commands to install the required packages:
Adding the Middleware
Open the Startup.cs file located in the project's root folder. Replace the complete class Startup with the following code:
Setting the Handler URLs
In your Angular project, change the webSocketURL attribute of the editor component in the app.component.html file to the URL of your backend application created above. Make sure that wss is used when the backend is hosted using Https and ws in case of Http.
For the DocumentViewer, set the basePath attribute to the URL: