Working with a Document Viewer Library – PDF, Office and CAD Viewing with Annotation and Text-Layer Search: A Practical Guide
← Back to Blog••7 min read

Working with a Document Viewer Library – PDF, Office and CAD Viewing with Annotation and Text-Layer Search: A Practical Guide

Doconut renders supported PDF, Office, and CAD files, with optional Annotation and Search plugins for markup and existing text layers. If you’re building a document‑centric portal, a legal‑tech case manager, or an engineering drawing review tool, you need a viewer that works the way your users do: instantly, securely, and without external services. Doconut runs in your own supported ASP.NET application and displays server-rendered pages through its browser viewer.

In this practical guide we’ll walk through the core workflow of the Document Viewer Library and its released Annotation, Search, and Converter plugins. By the end, you’ll have a ready‑to‑run prototype and a clear picture of how Doconut can become the backbone of any document‑heavy enterprise solution.

Secure enterprise document viewer displaying PDF, Office, and CAD files with annotation and printing tools
Secure enterprise document viewer displaying PDF, Office, and CAD files with annotation and printing tools

Windows Deployment and Free Trial Options

Doconut’s library runs on .NET 6 and is fully supported in Windows environments. Whether you host your app in Azure, AWS, or on‑premise, it delivers consistent rendering and annotation performance.

Doconut offers a 30-day temporary evaluation license. The released optional plugins include Annotation, Search for existing text layers, Converter, DICOM, and Signer.


Why the Document Viewer Library Is a Game‑Changer for .NET Enterprises

Enterprises that manage contracts, engineering schematics, or employee records face three recurring challenges:

  1. Format diversity – PDFs, Word documents, Excel spreadsheets, and CAD drawings coexist in the same repository.
  2. Collaborative review – Business users need to highlight, comment, or stamp a document without leaving the application.
  3. Regulated access – Printing must be auditable, and searchable text must be available even for scanned images.

Doconut's self-hosted viewer supports 75 file extensions across 18 format families, including DOCX, XLSX, PPTX, DWG, and DXF. The library renders each format natively, bypassing the need for Microsoft Office, Acrobat, or external conversion services. Because rendering happens on the server, you keep sensitive data behind your firewall, which is essential for healthcare, legal, and financial environments.

The optional Annotation plugin adds markup to rendered documents. The Search plugin searches text already present in a document's text layer; it does not OCR scanned images. Printing permissions, page limits, and print auditing must be implemented by the surrounding application.

Together, these capabilities let you replace a tangled stack of third‑party viewers, JavaScript plugins, and external conversion services with a single, maintainable library that scales from a handful of users to enterprise‑wide deployments.


Embedding the Viewer: Step‑by‑Step Integration in ASP.NET Core

Below is a concise description of the steps required to integrate Doconut’s Document Viewer Library into an ASP.NET Core application:

  1. Add the supported Doconut package – choose the package for .NET 8, .NET 6, .NET Standard 2.1, or .NET Framework 4.7.2 and follow its official host-specific integration instructions.
  2. Install the license – configure the offline .lic license for the self-hosted server deployment.
  3. Create a viewer instance – instantiate the Viewer class, passing in any required services such as a distributed cache or HTTP context accessor.
  4. Configure rendering options – set up a configuration object (for example, PdfConfig) to control default rendering behaviour, hyperlink extraction, and raster resolution for CAD drawings.
  5. Open a document – use the .NET server API to open a supported document and supply the browser viewer with the resulting opaque session token.

These steps result in a server‑side viewer for Windows environments running .NET 6. The HTML5/JavaScript viewer is served as part of the customer's self-hosted application and uses an opaque session token to request rendered content.


Built‑in Annotations for Real‑Time Review Workflows

Annotations turn a passive viewer into a collaborative workspace. Doconut’s annotation manager operates on a per‑page basis and stores everything as XML, which means you can easily version, audit, or merge changes in a database.

Typical annotation workflow

  1. Retrieve the annotation manager for the current page by calling the viewer’s GetAnnotationManager method, supplying the page dimensions.
  2. Create an annotation object (e.g., an image stamp, highlight, or free‑hand drawing) and set its position, size, and visual properties.
  3. Add the annotation to the manager.
  4. Persist the annotation XML using GetAnnotationXml and store it in your data store.
  5. When the document is re‑opened, load the saved XML back into the viewer with LoadAnnotationXML.

Enterprise scenarios

  • Legal Tech – Lawyers drop a “Signature” stamp onto a contract, then submit the XML to a case‑management service for audit.
  • Engineering Review – Designers add red‑line drawings directly on a DWG page; the annotation XML is stored alongside the revision history.
  • HR & Recruitment – Recruiters highlight key sections of a resume, add comments, and push the annotated version to the candidate’s profile.

The surrounding application remains responsible for deciding who may view documents, add annotations, or print. The API is deliberately thin: you only need the manager retrieval, add, and load methods, and you can build additional UI features (undo/redo, custom tools) on top without pulling in extra dependencies.


Text-Layer Search: Finding Existing Document Text

Doconut's Search plugin searches text already present in a supported document's text layer. Raster-only PDFs and scanned images require a separate OCR process to add searchable text before Doconut can search them.

Typical search workflow

  1. Call the viewer’s search method (exposed by the Search Plugin) with the desired keyword.
  2. Receive a list of matching page numbers and the coordinates of each match.
  3. For each match, obtain the page’s annotation manager and add a temporary highlight annotation to show the user where the term appears.

When a user opens a scanned or image-only PDF, Doconut renders its pages but does not create a searchable text layer. An external OCR process is required if the application needs to search that content.

Enterprise benefits

  • Customer portals can surface relevant clauses from a contract with a single keystroke.
  • Financial reporting tools let analysts locate a line item across dozens of scanned statements.
  • Healthcare record systems become searchable for medication names inside scanned physician notes, improving patient safety.

All of this is achieved with zero third‑party dependencies, keeping the stack lightweight and the compliance surface small.


Printing Rules Belong to the Surrounding Application

Doconut does not provide print-control functionality. Any printing permissions, page restrictions, or logging must be implemented by the surrounding application.

Typical printing workflow

  1. Define printing permissions in the surrounding application's authorization model.
  2. Implement any print-specific logging in the application's own audit system.
  3. Use Doconut's supported custom watermark on rendered pages when a visible watermark is required.

By handling printing on the server, Doconut ensures that the original document never leaves your protected environment, and you retain full visibility into print activity—a critical requirement for regulated industries.


Conclusion

Doconut's self-hosted Viewer renders supported PDF, Office, and CAD files, with optional Annotation and text-layer Search plugins. With server‑side processing, built‑in conversion, and support for over 33 file formats, you can eliminate costly third‑party dependencies and keep sensitive data under your direct control.

Ready to modernise your enterprise document workflow? Start your free trial of Doconut today, download the library, and follow the integration steps outlined above to bring powerful viewing, annotation, and search capabilities to your .NET application in minutes.

#Doconut#.NET#Document Viewer#Enterprise Development#PDF#CAD#Annotation