Live document
Explore the viewer
Use the viewer controls directly to navigate, select, search, print, or download the document.
Ready to tryUse the controls above to interact with this demo.
What this demonstrates
Read documents in any browser
Display Word-compatible documents with accurate pagination, thumbnails, text selection, search, printing, and downloading in a zero-footprint browser component.
Component settings
DocumentViewerSettings
How it works
The Razor view adds the viewer with Html.TXTextControl().DocumentViewer and assigns its document through DocumentPath. DockStyle.Fill uses the complete demo stage, while IsSelectionActivated and ShowThumbnailPane configure the initial viewing experience.
Key code
This is the Razor helper that adds the Document Viewer to the page.
<div class="tx-editor-host">
@Html.TXTextControl().DocumentViewer(settings => {
settings.Dock = DocumentViewerSettings.DockStyle.Fill;
settings.IsSelectionActivated = true;
settings.ShowThumbnailPane = true;
settings.DocumentPath = documentPath;
}).Render()
</div>
Source files
See the implementation
The view, browser behavior, assets, and controller are encapsulated in Demos/DocumentViewer/Concept.