This sample demonstrates using the GroupDocs Cloud API for document rendering instead of the local self-host API. Documents are rendered server-side via the GroupDocs Cloud service, so no local rendering engine is required.
- Configuring
AddGroupDocsViewerCloudApi()with Cloud API credentials - Using the Cloud API backend for document rendering
- Local file storage and cache with cloud-based rendering
- .NET 8.0 SDK or later
- A GroupDocs Cloud account with API credentials (Client ID and Client Secret)
- Sign up at GroupDocs Cloud Dashboard
- Create an application to get your Client ID and Client Secret
-
Update credentials in
Program.cs:var clientId = "your-client-id"; var clientSecret = "your-client-secret";
-
Run the sample:
cd samples/GroupDocs.Viewer.UI.Cloud.Api.Sample dotnet run
Open your browser at https://localhost:5001 (or the URL shown in the console output).
builder.Services
.AddControllers()
.AddGroupDocsViewerCloudApi(config =>
config
.SetClientId(clientId)
.SetClientSecret(clientSecret)
.SetViewerType(viewerType)
)
.AddLocalStorage("./Files")
.AddLocalCache("./Cache");Place document files in the ./Files directory. They will be uploaded to the Cloud API for rendering.