DocumentViewer for React Prerelease
We just published a prerelease version of the TX Text Control DocumentViewer for React. This tutorial shows how to create your first React application using the DocumentViewer.

We just published a prerelease version of the TX Text Control DocumentViewer for React on npm. Just like the DocumentViewer for Angular, it runs with the same ASP.NET (Core) backend powered by TX Text Control .NET Server.
React is a declarative, efficient, and flexible JavaScript library for building user interfaces. To learn more about React and to learn how to get started, please visit the React website.
Step 1: Trial Access Token
The easiest way to evaluate TX Text Control for React (and Angular) without hosting your own backend server is by creating a trial access token valid for 30 days.
Step 2: Creating the React App
-
Install Node.js® and npm, if not done before.
-
Open a Command Prompt and install create-react-app by running this command in your terminal:
npm install -g create-react-app
-
Run the following command to create a React application named mydocviewerapp:
npx create-react-app mydocviewerapp
-
Change into the created folder by typing in the following command:
cd mydocviewerapp
-
Install the TX Text Control document viewer package by typing in the following command:
npm install --save @txtextcontrol/tx-react-document-viewer
-
Open this folder in Visual Studio Code using this command:
code .
-
In Visual Studio Code, open the file src -> App.js, replace the content with the following code and save it. Replace yourtoken with your actual access token you created at the beginning of this tutorial.
import React from 'react' import DocumentViewer from '@txtextcontrol/tx-react-document-viewer' const signatureProps = { showSignatureBar: true, signatureBoxName: 'txsign', redirectUrlAfterSignature: 'https://www.textcontrol.com', ownerName: 'Paul', signerName: "Jakob", signerInitials: "PK" }; const App = () => { return <div> <p>DocumentViewer Sample</p> <DocumentViewer width= "800px" height ="500px" basePath = "https://backend.textcontrol.com?access-token=yourtoken" dock = "Fill" documentData = "SGkgdGhlcmU=" documentPath = "test.docx" isSelectionActivated = {true} showThumbnailPane = {true} signatureSettings = {signatureProps} toolbarDocked = {true} resources = "" /> </div> } export default App
-
Back in the command prompt, start the React application by typing in the following command:
npm start
Your default browser is opened with your created React app:
Related Posts
Building an ASP.NET Core Backend Application to Host the Document Editor and…
This article explains how to create an ASP.NET Core backend application to host the Document Editor and Document Viewer. This backend application is required to provide the required functionality…
How to Mail Merge MS Word DOCX Documents in ASP.NET Core C#
Mail merge is the process of merging data, such as Json or IEnumerable objects, into a template document, such as a DOC or DOCX file. This tutorial is a walkthrough of the steps necessary to…
ASP.NETASP.NET CoreDocumentViewer
Electronic Signatures: Requesting Signatures from Multiple Signers using…
This sample shows how to request signatures from multiple signers by using custom signature workflows and routing signature requests to custom endpoints.
Adding SVG Watermarks to Documents
This article shows how to add SVG images to document section headers that repeat automatically on each page. This watermark will be inserted vertically and horizontally centered on each section page.
Using MailMerge in ASP.NET Core 6 Web Applications
This article shows how to use the TX Text Control ASP.NET MailMerge class to merge templates with JSON data within a .NET 6 application in Visual Studio 2022.