The ASP.NET MVC DocumentViewer can be used to view all document types that are supported by TX Text Control including TX, DOC, DOCX, RTF and PDF.
When loading documents using the JavaScript load
╰ JavaScript API - Document Viewer Viewer
╰ TXDocumentViewer Object
╰ loadDocument Method
Loads a document from memory into the DocumentViewer. method or when loading from memory directly in the MVC view code, the document will be sent to the server in a POST request. For larger documents, it is required to increase the size of data that can be send to the server.
There are 3 areas in the web.config file that have to be adjusted to accept larger POST requests:
- IIS Request Filtering
- HttpRuntime maxRequestLength
- MaxJsonDeserializerMembers
IIS Request Filtering
On IIS level, the Request Filtering module is used to limit the size of data accepted by IIS. Increase the maxAllowedContentLength value that specifies the size of the POST buffer given in bytes.
The default size is 30000000 bytes (28.6 MB). Max value is 4294967295 bytes (4 GB)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Show hidden characters
<?xml version="1.0" encoding="UTF-8"?> | |
<configuration> | |
<system.webServer> | |
<security> | |
<requestFiltering> | |
<requestLimits maxAllowedContentLength="4294967295" /> | |
</requestFiltering> | |
</security> | |
</system.webServer> | |
</configuration> |
HttpRuntime maxRequestLength
ASP.NET has its own setting to limit the size of uploads and requests. Use the maxRequestLength of the httpRuntime element.
The default size is 4096 kilobytes (4 MB). Max value 2,147,483,647 kilobytes (~82 Terabyte). The following setting defines a max size of 500 megabytes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Show hidden characters
<?xml version="1.0" encoding="UTF-8"?> | |
<configuration> | |
<system.web> | |
<httpRuntime maxRequestLength="500000" executionTimeout="120" /> | |
</system.web> | |
</configuration> |
Pay attention to the different units used by these settings. Request Filtering is in bytes and HttpRuntime maxRequestLength is given in kilobytes.
MaxJsonDeserializerMembers
All data is send as JSON objects in the DocumentViewer client-server communication. The number of properties in a posted JSON object needs to be adjusted using the aspnet:MaxJsonDeserializerMembers application setting:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Show hidden characters
<configuration> | |
<appSettings> | |
<add key="aspnet:MaxJsonDeserializerMembers" value="10000" /> | |
</appSettings> | |
</configuration> |
By adjusting the above settings in your web.config, all document sizes can be loaded from memory.
ASP.NET Core .NET 6 .NET 7 .NET 8 Angular Blazor React JavaScript
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.
- Download Trial
- Trial Access Token
Getting started with:
- ASP.NET Core
- Angular
- Blazor
- JavaScript
- React
Download Trial
Related Posts
ASP.NET Angular
Using the Document Editor in SPA Applications using the removeFromDom Method
by Bjoern Meyer| September 2, 2024
This article shows how to use the removeFromDom method to remove the Document Editor from the DOM when it is no longer needed. This is useful when the Document Editor is used in a Single Page Application (SPA) and the component is not needed anymore.
Release Service Pack JavaScript SPA
ASP.NET Windows Forms WPF ActiveX
TX Text Control 32.0 Service Pack 4 Released
by Bjoern Meyer| September 2, 2024
We are very happy to announce the immediate availability of new Service Packs for TX Text Control 32.0 for all platforms including Windows Forms, WPF, ASP.NET, and ActiveX. This release includes various improvements and bug fixes.
Release Service Pack
ASP.NET
Document Viewer: Setting the Rendering Mode
by Bjoern Meyer| August 22, 2024
This article shows how to set the rendering mode of the Document Viewer. The rendering mode determines how the document is rendered and displayed in the viewer using Bitmap or SVG rendering.
ASP.NET Core Document Viewer
ASP.NET
View MS Word DOCX and PDF Documents using a .NET C# Document Viewer for ASP.NET Core and ASP.NET
by Bjoern Meyer| August 8, 2024
Learn how to view MS Word DOCX and PDF documents using a .NET C# Document Viewer for ASP.NET Core and ASP.NET. This article shows how to integrate the TX Text Control Document Viewer into your ASP.NET Core and ASP.NET applications.
ASP.NET Core Document Viewer