Products Technologies Demo Docs Blog Support Company

Feature Announcement: Enabling External PDF Renderer PDF.js in TX Text Control DocumentViewer

We are working on a feature that supports the enabling of external document renderers such as PDF.js to render PDF documents. This article gives a quick overview of the possibilities.

Feature Announcement: Enabling External PDF Renderer PDF.js in TX Text Control DocumentViewer

PDF.js is a JavaScript library maintained by Mozilla and other individual contributors. In a future release of our TX Text Control Document Viewer, we will introduce the option to enable external renderers such as PDF.js to provide the document rendering information.

Define the Renderer

In one of the next updates, it will be possible to define the location of PDF.js in the DocumentViewerSettings class through the DocumentLoadSettings. This allows you to specify which renderer should be used to render the loaded PDF document.

@Html.TXTextControl().DocumentViewer(settings => {
   settings.DocumentPath = Server.MapPath("~/App_Data/Documents/test.pdf");
   settings.Dock = DocumentViewerSettings.DockStyle.Fill;
   settings.IsSelectionActivated = true;
   settings.ShowThumbnailPane = true;
   settings.DocumentLoadSettings.PDFJS.BasePath = "https://cdnjs.cloudflare.com/ajax/libs/pdf.js/3.2.146";
}).Render()

After loading the document, the PDF is rendered in the Document Viewer using PDF.js.

TX Text Control with PDF.js

Advantages over pure PDF.js

After PDF.js is enabled, the document is rendered in the Document Viewer like any other supported file type including the thumbnail sidebar, zooming, annotations and the two page view mode:

TX Text Control with PDF.js

This provides users a consistent look and feel when viewing all types of documents in web applications.

When is PDF.js Better as a Renderer?

The answer is quite simple: TX Text Control doesn't provide a PDF renderer. When loading a PDF document into TX Text Control, the PDF is "imported". The idea is to import elements such as paragraphs, tables, and text and do further processing on such documents. Additionally, the TX Text Control PDF import provides the following features:

  • Full text search on PDF documents
  • Retrieve positions and coordinates of elements
  • Extract form field data
  • Radial search for strings and numbers
  • Extract structured documents such as ZUGFeRD

For pure rendering, the PDF.js renderer provides better results.

When not to use PDF Documents

The Document Viewer is mainly used to render documents in the supported formats DOC, DOCX, RTF and the internal Text Control format to help with the following tasks:

  • Document sharing
  • Document collaboration (annotations)
  • Document signing (electronic signatures)
  • Forms completion
  • Document reviewing

All of the above processes should use another document format than PDF to be as flexible as possible. A document should be editable as long as possible as a dynamic structure that should be updatable at any time. PDF is the worst format for these purposes.

When should a PDF be produced in a business workflow?

The answer is very simple: As late as possible.

Learn More

PDFs can be found everywhere: Invoices, brochures, contracts and agreements. It is a very reliable, portable format than became the clear industry standard for exchanging documents. This article suggests when to use this format and why.

Don't Create PDFs - Except You Need Them

When to use PDF Documents

When is a good time to create a PDF that is basically "write only"? Although, it is possible to make changes to a created PDF document like replacing small bits of text or removing complete pages. But when thinking about a PDF in a way like a printed paper sheet, you will get the idea of how dynamic digital document processing should be.

A document should be editable as long as possible. It is a dynamic structure that should be updatable at any time until the process is finished and a document is created for further processing or archiving.

You should use PDF documents in case there is no other option and your resulting documents are only stored in the PDF format or you would like to render incoming PDF documents from third-party sources. Specifically in these cases, PDF.js provides a high quality rendering result. To extract information such as form field data or attached documents, TX Text Control can be used directly.

Stay in the loop!

Subscribe to the newsletter to receive the latest updates.

ASP.NET

Integrate document processing into your applications to create documents such as PDFs and MS Word documents, including client-side document editing, viewing, and electronic signatures.

ASP.NET Core
Angular
Blazor
JavaScript
React
  • Angular
  • Blazor
  • React
  • JavaScript
  • ASP.NET MVC, ASP.NET Core, and WebForms

Learn more Trial token Download trial

Related Posts

ASP.NETASP.NET CoreDocument Viewer

Use PDF.js to Render PDF Documents within the Document Viewer

With the release of the latest release candidate of the Document Viewer, we released the ability to use PDF.js to render PDF documents. This article shows how to use this new feature.


ASP.NETAIASP.NET Core

Automating PDF/UA Accessibility with AI: Describing DOCX Documents Using TX…

This article shows how to use TX Text Control together with the OpenAI API to automatically add descriptive texts (alt text and labels) to images, links, and tables in a DOCX. The resulting…


ASP.NETASP.NET CoreJava

Converting Office Open XML (DOCX) to PDF in Java

Learn how to convert Office Open XML (DOCX) documents to PDF in Java using the powerful ServerTextControl library. This guide provides step-by-step instructions and code examples to help you…


ASP.NETASP.NET CoreDS Server

Extending DS Server with Custom Digital Signature APIs

In this article, we will explore how to extend the functionality of DS Server by integrating custom digital signature APIs. We will cover the necessary steps to create a plugin that allows DS…


ASP.NETASP.NET CorePDF

Why PDF/UA and PDF/A-3a Matter: Accessibility, Archiving, and Legal Compliance

It is more important than ever to ensure that documents are accessible, archivable, and legally compliant. PDF/UA and PDF/A-3a are two effective standards for addressing these needs. This article…