ZingPDF.FromHTML 1.0.59

dotnet add package ZingPDF.FromHTML --version 1.0.59
                    
NuGet\Install-Package ZingPDF.FromHTML -Version 1.0.59
                    
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="ZingPDF.FromHTML" Version="1.0.59" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="ZingPDF.FromHTML" Version="1.0.59" />
                    
Directory.Packages.props
<PackageReference Include="ZingPDF.FromHTML" />
                    
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 ZingPDF.FromHTML --version 1.0.59
                    
#r "nuget: ZingPDF.FromHTML, 1.0.59"
                    
#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 ZingPDF.FromHTML@1.0.59
                    
#: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=ZingPDF.FromHTML&version=1.0.59
                    
Install as a Cake Addin
#tool nuget:?package=ZingPDF.FromHTML&version=1.0.59
                    
Install as a Cake Tool

ZingPDF logomark

ZingPDF.FromHTML

ZingPDF.FromHTML provides HTML-to-PDF conversion helpers for ZingPDF using PuppeteerSharp.

Installation

dotnet add package ZingPDF.FromHTML

Reuse an installed browser

Set ZINGPDF_BROWSER_PATH to an installed browser executable. The example receives cancellationToken from the application.

using ZingPDF.FromHTML;

await using var renderer = new HtmlToPdfRenderer(new HtmlToPdfOptions
{
    BrowserExecutablePath = Environment.GetEnvironmentVariable("ZINGPDF_BROWSER_PATH")
        ?? throw new InvalidOperationException("Set ZINGPDF_BROWSER_PATH to an installed browser."),
    MaxConcurrency = 4,
    RenderTimeout = TimeSpan.FromSeconds(30)
});

await using var pdfStream = await renderer.RenderAsync("""
<!doctype html>
<html>
<head><style>@page { size: A4; margin: 15mm; }</style></head>
<body><h1>Invoice INV-1001</h1></body>
</html>
""", cancellationToken);

await using var output = File.Create("invoice.pdf");
await pdfStream.CopyToAsync(output, cancellationToken);

For any absolute URL supported by Chromium, including HTTP, HTTPS, file, data and about URLs, call renderer.RenderAsync(uri, navigationOptions, cancellationToken). NavigationOptions sets URL wait states and its navigation timeout (zero disables that timeout); a finite renderer deadline still covers the entire conversion.

Browser and print settings

  • Supply BrowserExecutablePath for an installed Chromium-compatible browser. AllowBrowserDownload defaults to false; enable it explicitly only if runtime downloading is intended.
  • Reuse one HtmlToPdfRenderer across jobs. It owns one browser and creates an isolated browser context for each conversion. MaxConcurrency defaults to 4; additional jobs queue.
  • RenderTimeout defaults to 30 seconds and covers queueing, browser startup, page loading, font readiness and PDF printing. Set it to Timeout.InfiniteTimeSpan to disable the overall deadline. BrowserStartupTimeout independently limits browser provisioning and launch to 30 seconds by default and must remain finite. Expiry throws TimeoutException; caller cancellation throws OperationCanceledException. Context creation and cleanup must complete to release resources; browser startup or downloading can remain renderer-owned after a caller stops waiting, within the separate startup budget. Disposal cancels browser provisioning. The deadline is not an OS-enforced hard worker bound.
  • The renderer snapshots options, including print options and launch arguments, at construction. The caller disposes the renderer and returned streams; templates and their converter adapter do not own the renderer.
  • New renderer defaults use print media, background printing and CSS page sizes. Set PdfOptions for paper, margins, page ranges or headers/footers. Original static Converter.ToPdfAsync(...) overloads retain automatic browser downloading, screen media and default PuppeteerSharp print settings. They disable the overall conversion deadline so explicit navigation timeouts, including zero, remain effective; the independent browser startup budget still defaults to 30 seconds. The overload taking HtmlToPdfOptions uses explicit settings for one job.
  • Offline = true emulates offline page networking. Embed fonts and images as data URLs. This setting is not an OS-level network sandbox or a security guarantee.
  • HTML and scripts must be trusted. Isolated browser contexts separate job state; they do not sandbox hostile code at the process or network boundary. The renderer does not disable Chromium's sandbox by default.

Invoice pagination example

examples/GenerateInvoices contains a Liquid invoice template and a Linux container recipe. It exercises 0, 1, 40 and 500 line items, repeated table headers, row preservation, totals and embedded fonts. Browser packages, fonts and OS libraries must be installed during deployment. Validate the recipe in the target Linux image.

Licensing

ZingPDF is proprietary software. Review LICENSE.txt and ensure you have paid license coverage with sufficient seats, or another applicable commercial agreement, before commercial use or commercial bundling. Versions released during a paid subscription remain licensed within the purchased scope after it ends; new versions and support require an active subscription.

Evaluation and other non-commercial use are free.

Support and compatibility

See SUPPORT.md in the package root or docs/project/SUPPORT.md in the repository for the current support stance and release-readiness notes.

More information

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 (1)

Showing the top 1 NuGet packages that depend on ZingPDF.FromHTML:

Package Downloads
ZingPDF.Templates.LiquidHtml

Liquid HTML template rendering for ZingPDF using Fluid and ZingPDF.FromHTML.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.59 102 10/11/2026
1.0.58 175 5/28/2026
1.0.57 141 5/25/2026
1.0.56 144 5/15/2026
1.0.54 141 4/19/2026
1.0.53 125 4/19/2026
1.0.51 123 4/19/2026
1.0.49 128 4/9/2026
1.0.48 125 4/7/2026
1.0.45 133 4/6/2026
1.0.44 128 4/6/2026
1.0.43 131 4/6/2026
1.0.40 122 4/5/2026
1.0.38 123 4/5/2026
1.0.37 118 4/5/2026
1.0.36 123 4/5/2026
1.0.35 129 4/4/2026
1.0.34 128 4/4/2026
1.0.33 127 4/4/2026
1.0.32 122 4/3/2026
Loading failed