AurorisNet.Pressroom.Client
1.3.2
dotnet add package AurorisNet.Pressroom.Client --version 1.3.2
NuGet\Install-Package AurorisNet.Pressroom.Client -Version 1.3.2
<PackageReference Include="AurorisNet.Pressroom.Client" Version="1.3.2" />
<PackageVersion Include="AurorisNet.Pressroom.Client" Version="1.3.2" />
<PackageReference Include="AurorisNet.Pressroom.Client" />
paket add AurorisNet.Pressroom.Client --version 1.3.2
#r "nuget: AurorisNet.Pressroom.Client, 1.3.2"
#:package AurorisNet.Pressroom.Client@1.3.2
#addin nuget:?package=AurorisNet.Pressroom.Client&version=1.3.2
#tool nuget:?package=AurorisNet.Pressroom.Client&version=1.3.2
AurorisNet.Pressroom.Client
The .NET client for Pressroom, a self-hosted service that turns a complete HTML document into a PDF or sends it to a configured printer.
The package calls a running Pressroom server over HTTP from a .NET 8 or .NET 10 application. It
holds the Pressroom.Client and Pressroom.Contracts assemblies and depends on no other package.
Rendering happens on the server: set one up first with the
getting started guide,
from a server release.
Install
dotnet add package AurorisNet.Pressroom.Client
Each GitHub release also holds the
.nupkg file, for a local feed.
Use
Give the client an HttpClient with your server's URL, ending in a slash, and your API key:
using Pressroom.Client;
using Pressroom.Contracts;
using var http = new HttpClient { BaseAddress = new Uri("https://pressroom.example/") };
http.DefaultRequestHeaders.Add("X-Api-Key", apiKey);
var pressroom = new PressroomClient(http);
var pdf = await pressroom.RenderAsync(new RenderRequest
{
Html = "<!doctype html><html><body><h1>Hello</h1></body></html>",
FileName = "hello.pdf"
});
await File.WriteAllBytesAsync(pdf.FileName, pdf.Bytes);
Reuse one HttpClient, or register a typed client with AddHttpClient<PressroomClient>.
| Method | What it does |
|---|---|
RenderAsync |
Returns the PDF in memory with its file name, page count and render time. |
RenderStreamAsync |
Returns a PdfRenderResult that streams the PDF. Dispose it after copying. |
PrintAsync |
Sends the document to a configured Windows or Linux printer and returns the receipt. |
SubmitAsync, GetJobAsync, WaitAsync |
Create a job on a server with jobs enabled, read its state, and wait for it to finish. |
DownloadAsync, DownloadStreamAsync, CancelAsync |
Fetch a job's PDF, and cancel a job or delete its result. |
RenderManyAsync |
Runs a batch through jobs with a limit on jobs in progress, and yields a PDF or an error for each request. |
IsReadyAsync |
Reads the server's health route. |
The client validates a request before it sends it and throws ArgumentException for invalid
values. An error response throws PressroomException with the HTTP status, the problem details
and the Retry-After delay. The client never retries a failed request: retries belong to your
application.
The client guide covers streaming, printing, batches and error handling, and the API reference lists every request option.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | 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. |
This package has no dependencies.
NuGet packages (1)
Showing the top 1 NuGet packages that depend on AurorisNet.Pressroom.Client:
| Package | Downloads |
|---|---|
|
AurorisNet.Umbraco.AppBlocks.Documents
Generate templated HTML and PDF documents from AppBlocks data sources. PDF conversion optionally uses Pressroom. |
GitHub repositories
This package is not used by any popular GitHub repositories.