GroupDocs.Viewer.UI.SelfHost.Api
26.8.0
Prefix Reserved
dotnet add package GroupDocs.Viewer.UI.SelfHost.Api --version 26.8.0
NuGet\Install-Package GroupDocs.Viewer.UI.SelfHost.Api -Version 26.8.0
<PackageReference Include="GroupDocs.Viewer.UI.SelfHost.Api" Version="26.8.0" />
<PackageVersion Include="GroupDocs.Viewer.UI.SelfHost.Api" Version="26.8.0" />
<PackageReference Include="GroupDocs.Viewer.UI.SelfHost.Api" />
paket add GroupDocs.Viewer.UI.SelfHost.Api --version 26.8.0
#r "nuget: GroupDocs.Viewer.UI.SelfHost.Api, 26.8.0"
#:package GroupDocs.Viewer.UI.SelfHost.Api@26.8.0
#addin nuget:?package=GroupDocs.Viewer.UI.SelfHost.Api&version=26.8.0
#tool nuget:?package=GroupDocs.Viewer.UI.SelfHost.Api&version=26.8.0
GroupDocs.Viewer.UI.SelfHost.Api
GroupDocs.Viewer.UI.SelfHost.Api is a self-hosted API implementation for GroupDocs.Viewer.UI that enables document viewing using GroupDocs.Viewer for .NET. It provides a local, self-contained solution for document viewing without requiring cloud services.
This package uses the GroupDocs.Viewer NuGet package. As of 26.8.0 GroupDocs.Viewer ships per-TFM runtime packages that are cross-platform on their own, so this package runs on Windows, Linux, and macOS with no GDI+ or libgdiplus required. The separate GroupDocs.Viewer.UI.SelfHost.Api.CrossPlatform package is deprecated - use this one.
Note: rendering of PSD, PSB, AI, and ONE documents is not available in 26.8.0. Those formats are provided only by the Windows-specific engine build, which this package does not use.
Installation
To use GroupDocs.Viewer.UI.SelfHost.Api in your ASP.NET Core project:
- Add the required package to your project:
dotnet add package GroupDocs.Viewer.UI.SelfHost.Api
- Configure the SelfHost API in your
Startupclass:
using GroupDocs.Viewer.UI.Core;
var builder = WebApplication.CreateBuilder(args);
var viewerType = ViewerType.HtmlWithEmbeddedResources;
builder.Services
.AddGroupDocsViewerUI();
builder.Services
.AddControllers()
.AddGroupDocsViewerSelfHostApi(config =>
{
config.SetViewerType(viewerType);
config.SetLicensePath("GroupDocs.Viewer.lic"); // Path to the license file
// Configure view options
config.ConfigureHtmlViewOptions(options => {
// Configure HTML view options
});
config.ConfigurePngViewOptions(options => {
// Configure PNG view options
});
config.ConfigureJpgViewOptions(options => {
// Configure JPG view options
});
config.ConfigurePdfViewOptions(options => {
// Configure PDF view options
});
// Configure internal caching
config.ConfigureInternalCaching(options => {
// Configure caching options
});
})
.AddLocalStorage("./Files");
var app = builder.Build();
app
.UseRouting()
.UseEndpoints(endpoints =>
{
endpoints.MapGroupDocsViewerUI(options =>
{
options.UIPath = "/viewer";
options.ApiEndpoint = "/viewer-api";
});
endpoints.MapGroupDocsViewerApi(options =>
{
options.ApiPath = "/viewer-api";
});
});
await app.RunAsync();
Configuration Options
The SelfHost API implementation provides the following configuration options:
LicensePath(Optional): Path to your GroupDocs.Viewer license file.ViewerType(Optional): The type of viewer to use. Options include:HtmlWithEmbeddedResources(default)HtmlWithExternalResourcesPngJpg
View Options Configuration
You can configure specific view options for different output formats:
config.ConfigureHtmlViewOptions(options => {
// Configure HTML view options
});
config.ConfigurePngViewOptions(options => {
// Configure PNG view options
});
config.ConfigureJpgViewOptions(options => {
// Configure JPG view options
});
config.ConfigurePdfViewOptions(options => {
// Configure PDF view options
});
Internal Caching
The internal caching mechanism stores rendered pages and document information in memory to improve performance:
- Uses memory cache to store rendered pages and document info
- Caches are keyed by document path and rendering parameters
- Default cache duration is 5 minutes (configurable)
- Automatically evicts old entries when memory is constrained
- Significantly improves performance for frequently accessed documents
The cache can be configured via the options shown in the example:
// Configure internal caching
config.ConfigureInternalCaching(options => {
// Configure caching options
options.DisableInternalCache(); // Disables internal caching
options.SetCacheEntryExpirationTimeoutMinutes(60); // Default values is 5 minutes
});
Performance Considerations
When using GroupDocs.Viewer.UI.SelfHost.Api:
- Processing is done locally on your server
- Memory usage depends on document size and complexity
- Internal caching can improve performance for repeated requests
- Best suited for:
- Applications requiring local document processing
- Environments with limited internet connectivity
- Scenarios where data privacy is important
- Performance depends on:
- Server hardware specifications
- Document size and complexity
- Chosen viewer type
- Caching configuration
License
This project is licensed under the MIT License - see the LICENSE.txt file for details.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net6.0 is compatible. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- GroupDocs.Viewer (>= 26.8.0)
- GroupDocs.Viewer.UI.Api (>= 26.8.0)
- GroupDocs.Viewer.UI.Core (>= 26.8.0)
-
net6.0
- GroupDocs.Viewer (>= 26.8.0)
- GroupDocs.Viewer.UI.Api (>= 26.8.0)
- GroupDocs.Viewer.UI.Core (>= 26.8.0)
- System.Formats.Asn1 (>= 8.0.2)
-
net8.0
- GroupDocs.Viewer (>= 26.8.0)
- GroupDocs.Viewer.UI.Api (>= 26.8.0)
- GroupDocs.Viewer.UI.Core (>= 26.8.0)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on GroupDocs.Viewer.UI.SelfHost.Api:
| Package | Downloads |
|---|---|
|
GroupDocs.Viewer.UI.SelfHost.Api.CrossPlatform
DEPRECATED - use GroupDocs.Viewer.UI.SelfHost.Api instead. GroupDocs.Viewer 26.8.0 ships per-TFM runtime packages that are cross-platform on Windows, Linux and macOS, so GroupDocs.Viewer.UI.SelfHost.Api is cross-platform too and this package has no reason to exist. Replace the reference with GroupDocs.Viewer.UI.SelfHost.Api - the namespaces, the AddGroupDocsViewerSelfHostApi() entry point and the configuration API are unchanged, so no code changes are needed. This version contains no assemblies. It only forwards to GroupDocs.Viewer.UI.SelfHost.Api. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 26.8.0 | 154 | 9/1/2026 |
| 26.4.0 | 355 | 4/29/2026 |
| 26.3.0 | 242 | 3/4/2026 |
| 8.1.5 | 168 | 2/19/2026 |
| 8.1.4 | 165 | 2/13/2026 |
| 8.1.3 | 155 | 2/11/2026 |
| 8.1.2 | 591 | 11/17/2025 |
| 8.1.1 | 349 | 9/21/2025 |
| 8.0.7 | 340 | 5/23/2025 |
| 8.0.6 | 410 | 5/5/2025 |
| 8.0.5 | 361 | 4/23/2025 |
| 8.0.4 | 333 | 4/22/2025 |
| 8.0.3 | 335 | 4/4/2025 |
| 8.0.2 | 356 | 2/6/2025 |
| 8.0.1 | 306 | 12/20/2024 |
| 8.0.0 | 316 | 12/16/2024 |
| 6.0.34 | 269 | 4/4/2025 |
| 6.0.33 | 635 | 3/25/2025 |
| 6.0.32 | 354 | 12/2/2024 |
| 6.0.31 | 310 | 11/7/2024 |