Meziantou.Framework.WebPlatform.PdfRendering 1.0.1

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

Meziantou.Framework.WebPlatform.PdfRendering

Prints the documents of Meziantou.Framework.WebPlatform to PDF with Meziantou.Framework.Pdf: the document is laid out with the print media type and paginated (@page rules, page breaks, page-margin boxes), and each page becomes a page of vector graphics and text.

// The rendering backend keeps and decodes the images, and rasterizes what PDF cannot draw
using var context = new BrowsingContext(new BrowsingContextOptions { RenderingBackend = new ImagingRenderingBackend() });
context.Navigate("https://example.com/", _ => """
    <!DOCTYPE html>
    <html lang="en">
    <title>Monthly report</title>
    <style>@page { size: A4; margin: 2cm }</style>
    <h1>Monthly report</h1>
    <p>See the <a href="https://example.com/details">details</a>.</p>
    """);
context.EventLoop.RunUntilIdle();

// A tagged PDF document (PDF/UA-1): text, links, bookmarks and the structure of the document
var pdf = context.PrintToPdf(options: new PdfPrintOptions { PdfUAConformance = PdfUAConformance.PdfUA1 });
var bytes = pdf.ToByteArray();
  • The text is shown with the font files the layout used, embedded as subsets, at the positions the layout computed: it can be selected, searched and extracted.
  • The images are embedded (the JPEG images as they are). The browsing context needs a RenderingBackend, such as the ImagingRenderingBackend of Meziantou.Framework.WebPlatform.Imaging, to keep the bytes of the images.
  • The links are link annotations (a fragment of the document is a destination in the PDF document), the headings are the outline (bookmarks), and the title, language, author, description and keywords of the document are its metadata.
  • The document is a tagged PDF: its structure tree is made from the elements of the document (headings, paragraphs, lists, tables, figures with their alternate text, links), and the decorations are artifacts. Set PdfUAConformance and PdfAConformance to write PDF/UA-1 and PDF/A documents.
  • What PDF cannot draw is drawn as an image (RasterizationScale pixels per CSS px): the blurred shadows, the filters, the masks and the compositing operators other than source-over, the 3D transforms, the conic gradients and the color glyphs.

See rendering.md.

Product Compatible and additional computed target framework versions.
.NET 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.  net11.0 is compatible. 
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 Meziantou.Framework.WebPlatform.PdfRendering:

Package Downloads
Meziantou.Framework.WebPlatform.Playwright

A Playwright server for Meziantou.Framework.WebPlatform: the Playwright clients (.NET, Node.js, Python, Java) connect to it with BrowserType.ConnectAsync and automate the managed browser engine (navigation, locators, actions, assertions, screenshots, network interception).

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.1 41 10/25/2026
1.0.0 48 10/24/2026