Step-by-step Tutorial: Developers embedding a secure, plugin‑free document viewer into ASP.NET Core, MVC, or WebForms applications
7/24/2026

Step-by-step Tutorial: Developers embedding a secure, plugin‑free document viewer into ASP.NET Core, MVC, or WebForms applications

Learn how to integrate Doconut App’s secure, plugin‑free document viewer into ASP.NET Core, MVC, or WebForms projects in a few easy steps. Supports PDF, Office, CAD, and 50+ formats.

Many developers start by looking for UI component libraries when they need to display documents in a web application. Doconut Viewer is a .NET SDK for adding plugin-free browser viewing to ASP.NET Core, MVC, or classic WebForms projects. Security still depends on the complete application architecture: authentication, authorization, transport, storage, validation, cleanup, patching, and monitoring.

Secure ASP.NET document viewer protected by layered application controls
Secure ASP.NET document viewer protected by layered application controls

1. Install the Doconut App SDK and Prepare Your .NET Project for Multiple File Formats

1.1 Add the supported package

Use the current package and setup instructions from the official Doconut download page. Record the chosen version and verify that it supports the target .NET runtime.

1.2 Verify the package reference

After installation, confirm the package reference and resolved version in the project file. Keeping versions explicit helps make builds and deployments reproducible.

1.3 Enable HTTPS

Doconut App requires SSL for all file uploads. Ensure your application listens on HTTPS. For a Kestrel‑hosted app, add an endpoint configuration in appsettings.json:

 {
   "Kestrel": {
     "Endpoints": {
       "Https": {
         "Url": "
       }
     }
   }
 }

If you host on IIS, bind an HTTPS certificate to the site. With HTTPS enabled, every file travels over a secure channel before reaching Doconut App’s rendering engine.

Why Doconut App? Doconut App is the only .NET‑native viewer that combines zero‑plugin rendering with end‑to‑end AES‑256 encryption, letting you meet compliance requirements without adding extra infrastructure.


2. Configure Secure File Uploads and Storage for Document Management

Doconut App’s security model is based on three pillars: SSL transport, AES‑256 encryption at rest, and automatic deletion after viewing. The SDK provides a ready‑made service you can register in your application.

2.1 Register the upload service

In Startup.cs (or Program.cs for .NET 6+), add the Doconut services to the dependency injection container. Configure a temporary storage folder, enable AES‑256 encryption, and set the auto‑deletion interval (for example, 10 minutes after the document is viewed).

2.2 Create the upload endpoint

Implement a controller action that receives an uploaded file, passes it to the Doconut service for secure storage, and returns a short one‑time token. The token is what the client‑side viewer will use to fetch and render the document.

2.3 Protect the endpoint

Because the upload endpoint deals with sensitive data, protect it with authentication and role‑based authorization (e.g., only users in the DocumentViewer role may upload). This ensures that only authorized personnel can store and view confidential documents.

Doconut App advantage: The SDK handles encryption and cleanup for you, so you never have to write custom cryptography code or worry about orphaned files.


3. Embed the Viewer Component in ASP.NET Core, MVC, or WebForms

With the backend ready, initialize the viewer using the assets and API documented for the installed Doconut version.

3.1 Add the JavaScript bundle

In your shared layout, include only the viewer resources described by the documentation that matches the installed SDK. Do not assume fixed bundle names or locations across versions.

3.2 Create a Razor view for Core/MVC

Add a view (e.g., Views/Document/View.cshtml) that contains a file input, a container element for the viewer, and a small script that uploads the selected file, receives the secure token, and initializes the Doconut Viewer widget.

The script should:

  1. Capture the selected file from the <input type="file"> element.
  2. Send the file to the upload endpoint using fetch or XMLHttpRequest.
  3. When the authorized response arrives, initialize the viewer using the supported API for the installed version.

3.3 WebForms equivalent

In a WebForms page (e.g., DocumentViewer.aspx), place an asp:FileUpload control, a button to trigger the upload, and a <div> that will host the viewer. In the code‑behind, call the Doconut service to store the uploaded file, obtain the token, and register a startup script that calls a JavaScript function (initViewer(token)) to create the viewer instance.

Benefit of Doconut App: One JavaScript widget, three .NET UI models, zero extra libraries. Simplicity at its best.


4. Customize the Viewer for Document Management

Out of the box, Doconut Viewer provides a clean toolbar, zoom controls, and a light/dark theme toggle. You can tailor the UI to match your brand and to suit specific document types.

4.1 Toolbar configuration

When initializing the viewer, you can specify which toolbar items should be visible (e.g., download, print, zoomIn, zoomOut, fullScreen). Removing the download button, for instance, prevents users from saving the original file.

4.2 Theme and colors

Set the theme option to 'dark' or 'light' and optionally provide a primaryColor that aligns with your corporate palette. The viewer respects CSS variables, allowing deeper styling via a custom stylesheet.

4.3 CAD‑specific tools

If you are displaying DWG, DXF, or DGN files, enable the CAD options enableMeasurement and enableLayerToggle. This adds distance, angle, and area measurement tools as well as a layer‑visibility panel directly in the toolbar.

4.4 Localization

Pass a locale code (e.g., 'fr' for French) during initialization. All UI strings, tooltips, and error messages will be displayed in the selected language.

Why customize? Doconut App lets you keep the viewer looking like a natural extension of your site while still delivering the same secure, plugin‑free experience.


5. Test the Integration Across All Supported Formats

Before going live, run a quick sanity check for each file type you expect your users to view. Using Doconut App’s viewer, open a sample file of each format and verify that rendering, navigation, and any specialized tools work as described.

FormatTest ScenarioExpected Result
PDFLarge, multi‑page report with embedded imagesSmooth scrolling, zoom, and accurate color rendering
DOCXWord document with tables and footnotesAll text, tables, and footnotes visible; no layout shift
XLSXSpreadsheet with chartsCharts render as vector graphics; zoom retains clarity
PPTXSlide deck with static previewFirst slide displays correctly; no broken assets
DWGTechnical drawing with multiple layersLayers toggle, measurements work, lines stay crisp
PSDPhotoshop file with layersLayers visible, colors exact, zoom stays sharp
SVGVector graphic with gradientsGradients render smoothly; zoom stays sharp
TIFFHigh‑resolution scanImage loads quickly; zoom reveals details

Running through this checklist with Doconut App ensures that every supported format behaves reliably for your users.


Conclusion

Embedding a secure, plugin‑free document viewer is now straightforward with Doconut App. By following the steps above—installing the SDK, configuring encrypted uploads, embedding the lightweight JavaScript widget, and customizing the UI—you can deliver fast, high‑quality document rendering across ASP.NET Core, MVC, and WebForms applications.

Ready to evaluate it? Start with the official Doconut download and documentation page, then test the SDK within the same security review applied to the rest of your Windows-based ASP.NET application.