This sample demonstrates the standard setup of GroupDocs.Viewer.UI with local self-host rendering, local file storage, and local cache. It serves as the starting point for most viewer integrations.
- Self-host API rendering documents as HTML with embedded resources
- Local file storage (
./Filesdirectory) - Local file cache (
./Cachedirectory) - Page preloading (first 3 pages rendered on initial request)
- .NET 8.0 SDK or later
cd samples/GroupDocs.Viewer.UI.Sample
dotnet runOpen your browser at https://localhost:5001 (or the URL shown in the console output).
// Rendering mode: HTML with embedded resources (default)
var viewerType = ViewerType.HtmlWithEmbeddedResources;
// UI is served at /viewer, API at /viewer-api
endpoints.MapGroupDocsViewerUI(options =>
{
options.UIPath = "/viewer";
options.ApiEndpoint = "/viewer-api";
});By default the sample runs in trial mode. To use a license:
config.SetLicensePath("GroupDocs.Viewer.lic");
// or set the GROUPDOCS_LIC_PATH environment variablePlace document files in the ./Files directory. They will appear in the viewer's file browser.