Document source
Inspect the in-memory document
This page starts with Base64 data supplied during Razor rendering. Navigate the result and use the toolbar to confirm that no public file URL is required.
Initialization sourceBase64 document data
The document bytes were assigned during Razor rendering; no public file URL is involved.
DATA
SourceDocumentData
Display namecar_insurance.tx
Ready to tryUse the controls above to interact with this demo.
What this demonstrates
Load from Base64 data
Read a document on the server, encode it as Base64, and pass it through DocumentData while supplying a friendly display name.
Document source
DocumentViewerSettings.DocumentData
Key members
DocumentData is useful when the source comes from a database, storage service, or generated memory buffer instead of a public file.
settings.DocumentData = Convert.ToBase64String(bytes);
settings.DocumentPath = "document.tx";
How it works
The view reads the server-side document bytes, converts them to Base64, and assigns the result to DocumentData. The viewer receives the complete payload during initialization, so the original file does not need to be exposed through a public URL.
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/FromData.