GroupDocs.Viewer.UI.SelfHost.Api.CrossPlatform 8.1.1

Prefix Reserved
dotnet add package GroupDocs.Viewer.UI.SelfHost.Api.CrossPlatform --version 8.1.1
                    
NuGet\Install-Package GroupDocs.Viewer.UI.SelfHost.Api.CrossPlatform -Version 8.1.1
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="GroupDocs.Viewer.UI.SelfHost.Api.CrossPlatform" Version="8.1.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="GroupDocs.Viewer.UI.SelfHost.Api.CrossPlatform" Version="8.1.1" />
                    
Directory.Packages.props
<PackageReference Include="GroupDocs.Viewer.UI.SelfHost.Api.CrossPlatform" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add GroupDocs.Viewer.UI.SelfHost.Api.CrossPlatform --version 8.1.1
                    
#r "nuget: GroupDocs.Viewer.UI.SelfHost.Api.CrossPlatform, 8.1.1"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package GroupDocs.Viewer.UI.SelfHost.Api.CrossPlatform@8.1.1
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=GroupDocs.Viewer.UI.SelfHost.Api.CrossPlatform&version=8.1.1
                    
Install as a Cake Addin
#tool nuget:?package=GroupDocs.Viewer.UI.SelfHost.Api.CrossPlatform&version=8.1.1
                    
Install as a Cake Tool

GroupDocs.Viewer.UI.SelfHost.Api.CrossPlatform

GroupDocs.Viewer.UI.SelfHost.Api.CrossPlatform is a cross-platform self-hosted API implementation for GroupDocs.Viewer.UI that enables document viewing using GroupDocs.Viewer for .NET cross-platform version. It provides a local, self-contained solution for document viewing that works across different operating systems.

This package uses the GroupDocs.Viewer.CrossPlatform NuGet package which provides a cross-platform graphical engine that works reliably on Linux and other operating systems. For Linux deployments, this package is the recommended choice over the Windows-optimized GroupDocs.Viewer.UI.SelfHost.Api.

Installation

To use GroupDocs.Viewer.UI.SelfHost.Api.CrossPlatform in your ASP.NET Core project:

  1. Add the required package to your project:
dotnet add package GroupDocs.Viewer.UI.SelfHost.Api.CrossPlatform
  1. Configure the CrossPlatform 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 CrossPlatform 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
});

Cross-Platform Support

This implementation is designed to work across different operating systems:

  • Windows
  • Linux
  • macOS

Performance Considerations

When using GroupDocs.Viewer.UI.SelfHost.Api.CrossPlatform:

  1. Processing is done locally on your server
  2. Memory usage depends on document size and complexity
  3. Internal caching can improve performance for repeated requests
  4. Best suited for:
    • Cross-platform applications
    • Environments with limited internet connectivity
    • Scenarios where data privacy is important
  5. Performance depends on:
    • Server hardware specifications
    • Document size and complexity
    • Chosen viewer type
    • Caching configuration
    • Operating system capabilities

License

This project is licensed under the MIT License - see the LICENSE.txt file for details.

Product 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
8.1.1 17 9/21/2025
8.0.7 218 5/23/2025
8.0.6 160 5/5/2025
8.0.5 153 4/23/2025
8.0.4 170 4/22/2025
8.0.3 142 4/4/2025
8.0.2 120 2/6/2025
8.0.1 126 12/20/2024
8.0.0 125 12/16/2024
6.0.9 141 4/4/2025
6.0.8 474 3/25/2025
6.0.7 155 12/2/2024
6.0.6 129 11/7/2024
6.0.5 192 9/30/2024
6.0.4 164 9/4/2024
6.0.3 109 8/2/2024
6.0.2 181 7/8/2024
6.0.1 166 6/11/2024