TX Text Control .NET Server

Document Viewer Examples

Topic

Displaying documents, collecting form data and electronic signatures, adding annotations: each task of the Document Viewer has an online demo that shows its code. The sample projects on GitHub combine the viewer with an ASP.NET Core backend in complete workflows, such as forms that users fill out and sign. Most of them were written for version 33.0 or earlier; the version is named with each sample, and GitHub Examples describes how to update one.

Online Demos

All demos run on the current version and show their view, controller and JavaScript on the Code tab:

ExampleWhat it showsWhere
ConceptThe Document Viewer in an ASP.NET Core viewConcept
Loading from a fileA document loaded from a file on the serverFrom File
Loading from dataA document passed as base64-encoded data from the memory of the serverFrom Data
Loading from JavaScriptA document loaded with the JavaScript APIFrom JavaScript
Electronic signaturesA complete signing process: the user signs the signature and initials boxes, and the server receives the signed documentElectronic Signatures
Raw signature dataThe strokes of a signature captured, inspected and replayedRaw Signature Data
PDF.jsPDF documents rendered in the browser with a locally hosted PDF.jsPDF.js Renderer
Uploading PDF documentsA local PDF file opened in the viewer with PDF.jsUploading PDFs
Flattened PDF formsCompleted form fields of a PDF flattened into a downloadSaving Form Fields
Form valuesForm field values exported as JSON or PDFExport Form Values
Saved form documentsA form saved with its values and loaded againSaving Form Fields
Conditional instructionsForm fields that validate and depend on each otherConditional Instructions
AnnotationsHighlights, comments, ink, text and stamps, and their JSON layer loaded and savedAnnotation Types, Loading and Saving
Signature annotationsA signature annotation merged into the document on the serverSignature Annotations
Custom stampsStamps of your own as annotationsCustom Stamps
Word commentsComments of a Word document shown as annotationsImporting Comments
Tracked changesReviewing, navigating and exporting tracked changesReview Tracked Changes
EventsEvents of annotations and signaturesEvent Handling
User interfaceThumbnails, toolbar and full screenVisual Elements
Search and navigationFinding text and scrolling to a pageFind Text, Scroll to Page

ASP.NET Core Samples

ExampleWhat it showsWhere
Custom signingA signature request handled by a controller of your application instead of JavaScript, as described in Handling Signature Requests in ASP.NET Core. Version 33.0TextControl.Web.MVC.CustomSigning
Signature hashesA hash of the raw signature data stored as evidence and checked later, as described in E-Sign: Validating Signature Hashes Generated from Vector Data in ASP.NET Core C#. Version 33.0TXTextControl.MVC.Core.Viewer.SignatureHash
Healthcare formsA digital forms workflow with electronic signatures, as described in Healthcare Use Case: Digital Forms Workflow with Electronic Signatures. Version 33.0TX.TextControl.Web.MVC.Core.SignWorkflow
Financial formsPrefilled forms that users complete and sign, as described in Transforming Financial Documents into Smart and Secure Forms in ASP.NET Core C#. Version 33.0TXTextControl.Web.MVC.Financial
Insurance claimsClaim forms created, deployed, filled out, signed and processed, as described in Use Case: Create, Deploy and Process Insurance Claim Forms. Version 33.0TextControl.Web.MVC.InsuranceClaim
Shared annotationsAnnotations shared live between users with SignalR, as described in DocumentViewer Collaboration: Live Share Document Annotations. Version 33.0TextControl.Web.MVC.DocumentViewer.Collaboration

The sample that shows the Document Editor and the Document Viewer in one view is listed in Document Editor Examples, and the samples that sign documents with a certificate after users signed them in the viewer are in Digital Signature Examples.

Blazor and Angular Samples

ExampleWhat it showsWhere
Blazor: signing with the viewer componentElectronic signatures with the DocumentViewer component of TXTextControl.Web.Blazor.DocumentViewer, signed with a certificate on the server, as described in E-Sign Comes to Blazor: Document Viewer 33.0.1 Released. Version 33.0TXTextControl.Blazor.Esign
Blazor Web App: signature workflowThe viewer in a Blazor Web App on .NET 8 that loads a document with SignatureSettings, receives the signed document in a controller and signs its signature field with a PFX certificate as PDF, as described in Handling Electronic Signatures in a Blazor Web App using .NET 8. Version 32.0TXTextControl.Server.Blazor.Viewer.Signature
Blazor Server with JavaScript interopThe viewer in a Blazor Server application on .NET 8 through JavaScript interop, as described in Using the Document Viewer in a Blazor Server App with .NET 8. Version 33.0TXTextControl.Server.Blazor.Viewer.DotNet8
Angular: preparing formsForms prepared for the viewer and a custom signing process in Angular and ASP.NET Core, as described in Preparing Forms for the Document Viewer and Customizing the Signing Process in Angular and ASP.NET Core. Version 32.0TXTextControl.Core.Angular.Forms.Prepare

Blazor and Angular in the Integration Guide describe the current setup.

React and JavaScript Articles

For React and plain JavaScript, the articles below hold their code in the article itself, without a repository to clone:

ExampleWhat it showsWhere
ReactThe viewer in a React application with the React packageUsing the TX Text Control Document Viewer in a React Application
Loading documents in ReactDocuments loaded from base64 data and from a URLLoading Documents into the Document Viewer in React
Form field valuesSaving the values of form fields in the documentDocument Viewer: Save the Values of Form Fields in Documents
Annotations across document typesAdding annotations and sharing them between document formatsAdding and Sharing Annotations across Document Types using the Document Viewer in ASP.NET Core C#
Rendering modeChoosing how the viewer renders pagesDocument Viewer: Setting the Rendering Mode

React and JavaScript in the Integration Guide describe the current setup.

Next Steps