This blog post contains outdated information.
The cited code snippets may be workarounds, and be part of the official API in the meantime.
Integrate Document Editing into any HTML Client using the HTML Widget
The TX Text Control JavaScript widget enables document editing in any HTML page without ASP.NET. Integration requires a script tag in the HEAD, a container DIV, and a widget constructor call with the container ID. The widget exposes the same JavaScript API as the ASP.NET MVC version.

We are providing a concept to support all non ASP.NET web applications such as Angular, React or any other framework and language.
Test this in JSFiddle
This JSFiddle is not longer available.
The following easy steps are required to add the HTML widget to any HTML page:
-
In order to integrate the widget to your HTML page, simply add the following JavaScript tag to the HEAD section:
<script src="https://labs.textcontrol.com/widget/scripts/txtextcontrol.web.js"></script> -
Then create a container DIV somewhere in your HTML that will host the widget. The editor itself will automatically fill the complete container.
<style> #myTextControlContainer { width: 1000px; height: 500px; margin-bottom: 20px; } </style> <div id="myTextControlContainer"></div> -
Finally, in a SCRIPT section, create a new widget by passing the container id in the constructor:
<script> var textControl1; window.onload = function() { textControl1 = new TXTextControlWeb("myTextControlContainer"); }; </script>
The object textControl1 is now the instance of the widget and can be used to access it's API to manipulate the document. It is possible to create more than one instance of the editor by creating new object instances with different containers.
The widget has (nearly) the same JavaScript API like the MVC version of TX Text Control Web. All objects, methods, properties and events can be used in the same way. For example, in order to load an HTML document into the editor, the following code can be used:
function loadDocument()
{
textControl1.loadDocument(
TXTextControl.StreamType.HTMLFormat,
btoa('<strong>This is a test</strong>'));
}
The documentation shows how to host your own widget:
TX Text Control Widget Programmer's Guide
The hosting widget project is open source and can be modified as required. You will find this project in our GitHub repository.
Angular
Integrate document processing, editing, sharing, collaboration, creation, electronic signatures, and PDF generation into your Angular Web applications.
Related Posts
Creating a WebSocket Server Project with Node.js
The @txtextcontrol/tx-websocket-server npm package enables Node.js to host the backend for TX Text Control document editors. This tutorial covers installing Express and the package, creating the…
Creating an Angular Document Editor Application
The @txtextcontrol/tx-ng-document-editor package integrates the TX Text Control HTML5 editor into Angular via Angular CLI. A WebSocket server handles WYSIWYG synchronization. This tutorial covers…
Deploying an Angular Application using the TX Text Control Widget
The TX Text Control Widget brings MS Word-compatible editing to Angular apps via an HTML5 editor hosted on a separate Windows server or Docker container. The deployment architecture separates the…
Create your First, Very Simple Angular Application with the TX Text Control…
The TX Text Control Widget embeds a cross-platform HTML5 document editor into Angular applications. This tutorial covers setting up Angular CLI, scaffolding a project, adding widget CSS and the…
Building an ASP.NET Core Backend (Linux and Windows) for the Document Editor…
This article shows how to create a backend for the Document Editor and Viewer using ASP.NET Core. The backend can be hosted on Windows and Linux and can be used in Blazor, Angular, JavaScript, and…
