Charta.Html 1.13.0

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

Charta.Html

HTML/CSS subset rendering for Charta — turn a fragment of HTML into a laid-out PDF. Parsing is done by AngleSharp; the CSS cascade and the layout are Charta's own. There is no browser and no native code.

using Charta;
using Charta.Html;

Document.Create(doc => doc.Page(page =>
{
    page.Margin(2, Unit.Centimeter);
    page.Content().Html("""
        <style>h1 { color: #003366 } .lead { color: #555 }</style>
        <h1>Hello</h1>
        <p class="lead">A <b>bold</b> word, an <i>italic</i> one, and a
        <a href="https://example.com">link</a>.</p>
        <ul><li>first</li><li>second</li></ul>
        """);
})).GeneratePdf("page.pdf");

What it maps

Area Supported
Block flow h1h6, p, div, section/article/header/footer/main/nav/figure, blockquote, pre, hr
Inline b/strong, i/em, u, s/del, span, a, sub, sup, small, code, br
Lists ul, ol, li with disc/circle/square/decimal markers
Tables table, thead, tbody, tr, th, td, including colspan/rowspan
Images img from data: URIs or file paths (block-level)
Flexbox display: flex with flex-direction, flex/flex-grow, gap, and justify-content — mapped to a row or column
Sizing absolute widths, and percentage widths when HtmlRenderOptions.ContentWidth is set (resolved against parent widths when nested)
Selectors type, .class, #id, *, and comma groups — from <style> blocks and inline style
Properties display, color, background-color, font-size/family/weight/style, text-align, text-decoration, text-transform, white-space (pre), letter-spacing, line-height, vertical-align, width (incl. %), margin, padding, border, list-style-type, and the flex properties above

What it does not

No combinators (>, +, descendant), pseudo-classes, most at-rules (@media, @font-face, @page), grid, floats, positioning, flex cross-axis alignment (align-items), or the font shorthand. Grid and @page are reported with guidance (use flexbox/tables; set the page via page.Size/page.Margin). These never throw — each distinct unsupported feature is reported once through HtmlRenderOptions.OnUnsupported and skipped:

page.Content().Html(markup, new HtmlRenderOptions
{
    BaseFontFamily = "Arial",
    OnUnsupported = message => Console.WriteLine(message),
});

Register the fonts you use with FontManager.RegisterFont for deterministic, server-side output.

MIT licensed, forever.

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 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. 
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.13.0 110 7/20/2026
1.12.0 103 7/10/2026
1.11.0 107 7/10/2026
1.7.0 102 7/10/2026