GroupDocs.Viewer.UI.SelfHost.Api
8.1.1
dotnet add package GroupDocs.Viewer.UI.SelfHost.Api --version 8.1.1
NuGet\Install-Package GroupDocs.Viewer.UI.SelfHost.Api -Version 8.1.1
<PackageReference Include="GroupDocs.Viewer.UI.SelfHost.Api" Version="8.1.1" />
<PackageVersion Include="GroupDocs.Viewer.UI.SelfHost.Api" Version="8.1.1" />
<PackageReference Include="GroupDocs.Viewer.UI.SelfHost.Api" />
paket add GroupDocs.Viewer.UI.SelfHost.Api --version 8.1.1
#r "nuget: GroupDocs.Viewer.UI.SelfHost.Api, 8.1.1"
#:package GroupDocs.Viewer.UI.SelfHost.Api@8.1.1
#addin nuget:?package=GroupDocs.Viewer.UI.SelfHost.Api&version=8.1.1
#tool nuget:?package=GroupDocs.Viewer.UI.SelfHost.Api&version=8.1.1
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 which relies on System.Drawing.Common and is optimized for Windows environments. For Linux deployments, we recommend using GroupDocs.Viewer.UI.SelfHost.Api.CrossPlatform
instead, which utilizes GroupDocs.Viewer.CrossPlatform
with its cross-platform graphical engine.
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
Startup
class:
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)HtmlWithExternalResources
Png
Jpg
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 was computed. 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. |
-
net6.0
- GroupDocs.Viewer (>= 25.8.0)
- GroupDocs.Viewer.UI.Api (>= 8.1.1)
- GroupDocs.Viewer.UI.Core (>= 8.1.1)
- System.Formats.Asn1 (>= 8.0.2)
- System.Text.Json (>= 8.0.6)
-
net8.0
- GroupDocs.Viewer (>= 25.8.0)
- GroupDocs.Viewer.UI.Api (>= 8.1.1)
- GroupDocs.Viewer.UI.Core (>= 8.1.1)
- System.Formats.Asn1 (>= 8.0.2)
- System.Text.Json (>= 8.0.6)
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last Updated |
---|---|---|
8.1.1 | 0 | 9/21/2025 |
8.0.7 | 0 | 5/23/2025 |
8.0.6 | 0 | 5/5/2025 |
8.0.5 | 0 | 4/23/2025 |
8.0.4 | 0 | 4/22/2025 |
8.0.3 | 0 | 4/4/2025 |
8.0.2 | 0 | 2/6/2025 |
8.0.1 | 2 | 12/20/2024 |
8.0.0 | 3 | 12/13/2024 |
6.0.34 | 0 | 4/4/2025 |
6.0.33 | 0 | 3/25/2025 |
6.0.32 | 0 | 12/19/2024 |
6.0.30 | 0 | 9/30/2024 |
6.0.29 | 1 | 9/6/2024 |
6.0.26 | 2 | 6/11/2024 |
6.0.25 | 1 | 6/6/2024 |
6.0.23 | 2 | 4/1/2024 |
6.0.21 | 2 | 2/3/2024 |
6.0.20 | 3 | 2/1/2024 |
6.0.19 | 3 | 12/28/2023 |
6.0.18 | 1 | 11/3/2023 |
6.0.17 | 2 | 10/6/2023 |
6.0.16 | 2 | 9/1/2023 |
6.0.15 | 2 | 6/29/2023 |
6.0.14 | 1 | 6/28/2023 |
6.0.13 | 2 | 6/23/2023 |
6.0.11 | 2 | 4/5/2023 |
6.0.10 | 1 | 4/4/2023 |
6.0.9 | 1 | 4/2/2023 |
6.0.8 | 1 | 3/30/2023 |
6.0.6 | 1 | 3/26/2023 |
6.0.3 | 2 | 1/28/2023 |
6.0.2 | 1 | 12/1/2022 |
6.0.1 | 2 | 10/1/2022 |
6.0.0 | 3 | 7/23/2022 |
3.1.20 | 1 | 7/17/2022 |
3.1.19 | 1 | 7/16/2022 |
3.1.18 | 1 | 7/15/2022 |
3.1.17 | 1 | 7/4/2022 |
3.1.16 | 2 | 6/21/2022 |
3.1.15 | 2 | 6/2/2022 |
3.1.14 | 1 | 5/26/2022 |
3.1.13 | 2 | 5/21/2022 |
3.1.12 | 1 | 5/12/2022 |
3.1.11 | 2 | 5/7/2022 |
3.1.10 | 2 | 1/21/2022 |
3.1.9 | 2 | 12/22/2021 |
3.1.8 | 2 | 11/18/2021 |
3.1.7 | 2 | 10/21/2021 |
3.1.6 | 2 | 10/21/2021 |
3.1.5 | 1 | 10/20/2021 |
3.1.4 | 3 | 9/21/2021 |
3.1.3 | 3 | 9/19/2021 |
3.1.2 | 2 | 8/18/2021 |
3.1.1 | 2 | 7/26/2021 |
3.1.0 | 3 | 7/9/2021 |