Gotenberg.Sharp.API.Client
3.0.0
dotnet add package Gotenberg.Sharp.API.Client --version 3.0.0
NuGet\Install-Package Gotenberg.Sharp.API.Client -Version 3.0.0
<PackageReference Include="Gotenberg.Sharp.API.Client" Version="3.0.0" />
<PackageVersion Include="Gotenberg.Sharp.API.Client" Version="3.0.0" />
<PackageReference Include="Gotenberg.Sharp.API.Client" />
paket add Gotenberg.Sharp.API.Client --version 3.0.0
#r "nuget: Gotenberg.Sharp.API.Client, 3.0.0"
#:package Gotenberg.Sharp.API.Client@3.0.0
#addin nuget:?package=Gotenberg.Sharp.API.Client&version=3.0.0
#tool nuget:?package=Gotenberg.Sharp.API.Client&version=3.0.0
<h1> <img src="https://raw.githubusercontent.com/ChangemakerStudios/GotenbergSharpApiClient/refs/heads/develop/resources/gotenberg-sharp-client.png" width="48" height="48" align="top" /> Gotenberg Sharp API Client </h1>
.NET C# client for Gotenberg v7 & v8 — a Docker-powered stateless API for converting & merging HTML, Markdown, and Office documents to PDF. Includes a configurable Polly retry policy with exponential backoff.
v3.0.0 — Screenshots, standalone PDF operations (flatten/rotate/split/encrypt), cross-cutting watermark & stamp options, LibreOffice conversion options, .NET 10/9/8 + netstandard 2.x. See CHANGES.MD for details.
Features
- HTML/URL to PDF with Chromium (page properties, headers/footers, cookies, wait conditions)
- Screenshots of HTML or URLs as PNG, JPEG, or WebP
- Office to PDF via LibreOffice (100+ formats, image compression, watermarks)
- PDF Manipulation — merge, flatten, rotate, split, encrypt, watermark, stamp
- PDF/A & PDF/UA compliance, metadata read/write
- Webhooks for async PDF generation
- DI-Ready with Polly retry policies
Quick Start
docker run --rm -p 3000:3000 gotenberg/gotenberg:latest
dotnet add package Gotenberg.Sharp.Api.Client
// Startup.cs
services.AddOptions<GotenbergSharpClientOptions>()
.Bind(Configuration.GetSection("GotenbergSharpClient"));
services.AddGotenbergSharpClient();
HTML to PDF
var builder = new HtmlRequestBuilder()
.AddDocument(doc => doc.SetBody("<html><body><h1>Hello PDF!</h1></body></html>"))
.WithPageProperties(pp => pp.UseChromeDefaults());
var result = await sharpClient.HtmlToPdfAsync(builder);
Screenshot
var builder = new ScreenshotHtmlRequestBuilder()
.AddDocument(doc => doc.SetBody("<html><body><h1>Screenshot!</h1></body></html>"))
.WithScreenshotProperties(p => p.SetSize(1280, 720).SetFormat(ScreenshotFormat.Png));
var imageStream = await sharpClient.ScreenshotHtmlAsync(builder);
Office to PDF
var builder = new MergeOfficeBuilder()
.WithAsyncAssets(async a => a.AddItems(await GetDocsAsync(sourceDir)))
.SetLibreOfficeOptions(o => o.SetQuality(85).SetExportBookmarks())
.SetPdfOutputOptions(o => o.SetPdfFormat(PdfFormat.A2b));
var result = await sharpClient.MergeOfficeDocsAsync(builder);
PDF Operations
// Rotate
using var rotated = await sharpClient.ExecutePdfEngineAsync(
PdfEngineBuilders.Rotate(90).WithPdfs(a => a.AddItem("doc.pdf", bytes)));
// Encrypt
using var encrypted = await sharpClient.ExecutePdfEngineAsync(
PdfEngineBuilders.Encrypt("reader123", "admin456").WithPdfs(a => a.AddItem("doc.pdf", bytes)));
// Watermark (inline, on any conversion)
var builder = new HtmlRequestBuilder()
.AddDocument(doc => doc.SetBody(html))
.SetWatermarkOptions(w => w.SetTextWatermark("DRAFT"));
Documentation
See the full documentation for:
- Getting Started — setup, configuration, DI
- HTML & URL to PDF — Chromium features, page properties, cookies
- Screenshots — PNG/JPEG/WebP capture
- Office Conversion — LibreOffice options
- PDF Manipulation — merge, rotate, split, encrypt, watermark
- Advanced Features — webhooks, value objects, multi-URL merge
Examples
See the examples folder for complete working console applications.
Release History
See CHANGES.MD for the full release history.
Star History
<a href="https://www.star-history.com/?repos=ChangemakerStudios%2FGotenbergSharpApiClient&type=date&legend=bottom-right"> <picture> <source media="(prefers-color-scheme: dark)" srcset="https://api.star-history.com/chart?repos=ChangemakerStudios/GotenbergSharpApiClient&type=date&theme=dark&legend=bottom-right" /> <source media="(prefers-color-scheme: light)" srcset="https://api.star-history.com/chart?repos=ChangemakerStudios/GotenbergSharpApiClient&type=date&legend=bottom-right" /> <img alt="Star History Chart" src="https://api.star-history.com/chart?repos=ChangemakerStudios/GotenbergSharpApiClient&type=date&legend=bottom-right" /> </picture> </a>
License
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. 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 is compatible. 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. |
| .NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.0 is compatible. netstandard2.1 is compatible. |
| .NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
| MonoAndroid | monoandroid was computed. |
| MonoMac | monomac was computed. |
| MonoTouch | monotouch was computed. |
| Tizen | tizen40 was computed. tizen60 was computed. |
| Xamarin.iOS | xamarinios was computed. |
| Xamarin.Mac | xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.0
- Microsoft.Bcl.HashCode (>= 1.1.1)
- Microsoft.Extensions.DependencyInjection (>= 2.2.0)
- Microsoft.Extensions.Http (>= 2.2.0)
- Microsoft.Extensions.Http.Polly (>= 2.2.0)
- MimeMapping (>= 3.0.1)
- Newtonsoft.Json (>= 13.0.3)
-
.NETStandard 2.1
- Microsoft.Extensions.DependencyInjection (>= 3.1.5)
- Microsoft.Extensions.Http (>= 3.1.5)
- Microsoft.Extensions.Http.Polly (>= 3.1.5)
- MimeMapping (>= 3.0.1)
- Newtonsoft.Json (>= 13.0.3)
-
net10.0
- Microsoft.Extensions.DependencyInjection (>= 10.0.0)
- Microsoft.Extensions.Http (>= 10.0.0)
- Microsoft.Extensions.Http.Polly (>= 10.0.0)
- MimeMapping (>= 3.0.1)
- Newtonsoft.Json (>= 13.0.3)
-
net8.0
- Microsoft.Extensions.DependencyInjection (>= 8.0.0)
- Microsoft.Extensions.Http (>= 8.0.0)
- Microsoft.Extensions.Http.Polly (>= 8.0.7)
- MimeMapping (>= 3.0.1)
- Newtonsoft.Json (>= 13.0.3)
-
net9.0
- Microsoft.Extensions.DependencyInjection (>= 9.0.0)
- Microsoft.Extensions.Http (>= 9.0.0)
- Microsoft.Extensions.Http.Polly (>= 9.0.0)
- MimeMapping (>= 3.0.1)
- Newtonsoft.Json (>= 13.0.3)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on Gotenberg.Sharp.API.Client:
| Package | Downloads |
|---|---|
|
SpCraft.Net.Common.Pdf
Package Description |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 3.0.0 | 718 | 4/6/2026 |
| 2.8.5 | 4,490 | 3/27/2026 |
| 2.8.4 | 134,164 | 10/18/2025 |
| 2.8.3 | 30,241 | 10/6/2025 |
| 2.8.1 | 534 | 10/5/2025 |
| 2.8.0 | 280,640 | 3/25/2025 |
| 2.5.0 | 48,863 | 2/7/2025 |
| 2.4.0 | 235,602 | 8/10/2024 |
| 2.3.0 | 122,232 | 4/17/2024 |
| 2.2.2 | 65,185 | 1/30/2024 |
| 2.1.1 | 326,754 | 10/1/2022 |
| 2.0.2 | 68,172 | 8/30/2022 |
| 2.0.1 | 1,576 | 8/30/2022 |
| 2.0.0-alpha0002 | 36,109 | 3/3/2022 |
| 1.2.0 | 110,844 | 5/11/2021 |
v3.0.0 - Major release: Screenshot operations (HTML/URL to PNG/JPEG/WebP). Standalone PDF engine operations (flatten, rotate, split, encrypt, metadata). Cross-cutting watermark, stamp, rotation, and split options. LibreOffice conversion options. PDF encryption. Additional Chromium fields. Dropped .NET 5/6/7; added .NET 9/10. Namespace reorganization (builders moved to Application layer). See CHANGES.MD for full details.
v2.8.5 - Added support for the GenerateTaggedPdf flag.
v2.8.4 - Fixed hybrid configuration for basic authentication credentials.
v2.8.3 - Added programmatic configuration support. Comprehensive documentation improvements.
v2.8.1 - Added cookie support, basic auth, SinglePage property.
v2.8 - PDF formatting improvements, flatten support.
v2.0 - Upgraded to support Gotenberg v7.