Blog

PaperAPI .NET SDK is live on NuGet

Dec 26, 2025
sdksdotnet
PaperAPI .NET SDK is live on NuGet

We're shipping the PaperAPI .NET SDK so C# and ASP.NET teams can turn HTML into PDFs without wiring raw HTTP calls. The package targets netstandard2.0, runs cleanly on .NET 8+, and wraps every PaperAPI endpoint (sync, async, jobs, usage, whoami, and health) behind a single PaperApiClient.

Why .NET teams asked for this launch

  • Typed models for every request/response plus enum-friendly options to keep invoice, statement, and contract templates predictable.
  • Retry-ready HTTP plumbing that reuses your existing HttpClient, adds a PaperAPI user agent, and surfaces failures through a single PaperApiException.
  • Secure defaults with bearer auth, base URL validation, and no extra dependencies—ideal for regulated workloads that rely on our EU-only infrastructure.
  • Async + queue support so background workers can enqueue, poll, and download heavy PDF jobs without duplicating state machines.

All of the above is documented inside the PaperAPI GitHub repository, which also contains CI/CD workflows, console samples, and release automation.

Install from NuGet in seconds

Grab the package straight from nuget.org/packages/PaperApi:

dotnet add package PaperApi
Tip: keep PAPERAPI_BASE_URL and PAPERAPI_API_KEY in a .env file so every environment (local, staging, production) resolves the right endpoint with zero code edits.

Render your first PDF with PaperApiClient

using PaperApi;
using PaperApi.Models;

var client = new PaperApiClient(new PaperApiOptions
{
    ApiKey = Environment.GetEnvironmentVariable("PAPERAPI_API_KEY")!,
    BaseUrl = Environment.GetEnvironmentVariable("PAPERAPI_BASE_URL")
});

var pdfBytes = await client.GeneratePdfAsync(new PdfGenerateRequest
{
    Html = "<html><body><h1>Hello from PaperAPI</h1></body></html>",
    Options = new PdfOptions
    {
        PageSize = "A4",
        MarginTop = 5,
        MarginBottom = 5
    }
});

await File.WriteAllBytesAsync("invoice.pdf", pdfBytes);

Need asynchronous batching instead? Swap GeneratePdfAsync for EnqueuePdfJobAsync, poll with GetJobStatusAsync, and download the finished document with DownloadJobResultAsync. Health checks (CheckHealthAsync), usage summaries (GetUsageSummaryAsync), and account metadata (GetWhoAmIAsync) are all one-liners.

Production-ready from day one

  • CI packs the SDK with XML docs, README content, and symbols so NuGet renders a rich package page and IDEs show inline help.
  • Source lives alongside examples in GitHub, so you can fork, audit, or open issues where the SDK, docs, and release workflows already live.
  • PaperApiException.FromJson exposes HTTP codes plus error bodies, helping your logging, retry, and alerting hooks stay actionable.
  • Every method accepts cancellation tokens, making it easy to plug the SDK into worker queues, ASP.NET Minimal APIs, or event-driven functions.

Explore the SDK ecosystem

Questions about feature gaps or runtime support? Email founders@paperapi.de and we'll prioritize the next SDK drop together.