Viewer interface
Control visual elements
Change the viewer chrome without rebuilding or reloading the document.
Visible surfacesShape the viewer workspace
Each action changes only the browser interface; the document stays loaded.
UI
Ready to tryUse the controls above to interact with this demo.
What this demonstrates
Control the viewer chrome
Toggle thumbnails, the toolbar, and browser full-screen mode through the public JavaScript API.
API used
TXDocumentViewer.toolbar.show
Key members
Toolbar, thumbnails, and full-screen mode are independent viewer surfaces that can be changed while the document is open.
if (toolbarVisible) {
TXDocumentViewer.toolbar.hide();
} else {
TXDocumentViewer.toolbar.show();
}
How it works
The Razor helper prepares the browser viewer and its document. Demo-specific JavaScript uses the public TXDocumentViewer API and remains encapsulated with this demo.
NuGet packages
Displays supported document and PDF formats in the browser.
dotnet add package TXTextControl.Web.DocumentViewer --version 34.2.0
Source files
See the implementation
The view, browser behavior, assets, and controller are encapsulated in Demos/DocumentViewer/Advanced/VisualElements.