This blog post contains outdated information.
The cited code snippets may be workarounds, and be part of the official API in the meantime.
Using the DocumentViewer in Pure HTML and JavaScript
The TX Text Control DocumentViewer cannot be only used in ASP.NET, ASP.NET Core and Angular applications, but also in pure HTML and JavaScript applications. This tutorial shows how to create a simple HTML application using the DocumentViewer.

The new prerelease version of the TX Text Control DocumentViewer NuGet package allows you to host the required backend endpoints in an ASP.NET or ASP.NET Core Web Application. This backend can then be used by the Angular version of the DocumentViewer.
But this backend also allows you to initialize the TX Text Control DocumentViewer in a pure HTML and JavaScript environment.
In order to use this, you will have to create a trial access token to use the backend server.
Access TokenAdding the Viewer to HTML
-
Add the Script tag to your HTML file in the head section:
<script src="https://backend.textcontrol.com/TextControl/GetResource?Resource=minimized.tx-viewer.min.js&access-token=yourtoken"></script>
When hosted on your own, replace https://backend.textcontrol.com with your endpoint URL.
-
Add a hosting element to your HTML:
<div id="txViewerHost"></div>
-
Add the following script tag to your HTML and set the id of the hosting element to the containerID property:
<script> // create a new DocumentViewer TXDocumentViewer.init( { containerID: 'txViewerHost', viewerSettings: { toolbarDocked: true, dock: "Fill", isSelectionActivated: true, showThumbnailPane: true, basePath: 'https://backend.textcontrol.com', } }); </script>
Also here, replace the basePath with your endpoint URL when hosted on your own.