Paperwork.Core 1.1.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package Paperwork.Core --version 1.1.0
                    
NuGet\Install-Package Paperwork.Core -Version 1.1.0
                    
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="Paperwork.Core" Version="1.1.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Paperwork.Core" Version="1.1.0" />
                    
Directory.Packages.props
<PackageReference Include="Paperwork.Core" />
                    
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 Paperwork.Core --version 1.1.0
                    
#r "nuget: Paperwork.Core, 1.1.0"
                    
#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 Paperwork.Core@1.1.0
                    
#: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=Paperwork.Core&version=1.1.0
                    
Install as a Cake Addin
#tool nuget:?package=Paperwork.Core&version=1.1.0
                    
Install as a Cake Tool

Paperwork.Core

Core PDF generation library for Paperwork. Provides a fluent builder API over the Scryber rendering engine, to generate PDFs from HTML templates, CSS, and JSON data. to generate PDFs from HTML templates, CSS, and JSON data.

Installation

dotnet add package Paperwork.Core

Quick Start

using Paperwork;

var factory = PaperworkFactory.Create(httpClient).Build();

var bytes = await factory.NewDocument()
    .WithLayout("<html><body><p data-content='{{fields[\"title\"]}}'></p></body></html>")
    .WithField("title", "Hello World")
    .BuildBytesAsync();

await File.WriteAllBytesAsync("output.pdf", bytes);

Usage

Setup

// Minimal — no auth
var factory = PaperworkFactory.Create(httpClient).Build();

// With custom auth
var factory = PaperworkFactory.Create(httpClient)
    .WithAuth(new MyAuthService())
    .Build();

// ASP.NET Core DI
services.AddPaperwork();

Layout

// Inline HTML string
builder.WithLayout("<html><body>...</body></html>");

// From a file
builder.WithLayoutFile("invoice.html");

// From a URL (fetched at render time)
builder.WithLayoutUrl("https://cdn.example.com/template.html");

// Pre-built Scryber Document
builder.WithLayout(document);

Styles

builder.WithStyle("body { font-family: sans-serif; }");
builder.WithStyleFile("styles.css");
builder.WithStyleUrl("https://cdn.example.com/styles.css");
builder.WithStyle(styleGroup);  // Scryber StyleGroup

Data

// JSON string — bound as {{name.field}} in templates
builder.WithData("order", "{\"total\": 1200}");

// From a file
builder.WithDataFile("order", "order.json");

// Any object — set directly on doc.Params
builder.WithData("order", new { total = 1200 });

Fields

Scalar values accessible in templates as fields["key"]:

builder.WithField("date", "2026-03-25");
builder.WithField("title", "Invoice #1001");
<p data-content='{{fields["title"]}}'></p>

Generate

// As bytes
byte[] pdf = await builder.BuildBytesAsync();

// Save to file
await builder.SaveAsync("output.pdf");

// Full result with metadata
PaperworkResult result = await builder.BuildAsync();

Template Binding

Inside HTML templates, use handlebars-style expressions:


<p data-content='{{fields["date"]}}'></p>


<p data-content='{{order.customerName}}'></p>


{{#each items}}
<p data-content='{{this.label}}'></p>
{{/each}}

License

MIT

Product 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 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
1.2.0 44 3/27/2026
1.1.0 43 3/27/2026
1.0.0 32 3/26/2026