Document source
Inspect a server-side file
The viewer loads the document from a server path while keeping the physical file outside the public static-file surface. Use the toolbar to browse the rendered result.
Initialization sourceProtected server path
The physical asset remains server-side while the viewer receives its rendered representation.
FILE
SourceDocumentPath
Assetcar_insurance.tx
Ready to tryUse the controls above to interact with this demo.
What this demonstrates
Load from a server file
Point the Razor helper at a supported document on the server and let the viewer prepare it for browser display.
Document source
DocumentViewerSettings.DocumentPath
Key members
DocumentPath points to a server-side file while the viewer handles conversion and browser rendering without exposing the physical path.
settings.DocumentPath = Path.Combine(
environment.ContentRootPath,
"Assets",
"document.tx"
);
How it works
The Razor helper receives an absolute server-side path through DocumentPath. TX Text Control prepares that document for viewing while the physical file remains on the server, and the browser receives only the viewer resources required for display.
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/Loading/FromFile.