Recursive AI
LibraryC#Available

onerender

An HTML and CSS rendering engine for .NET, written in C# from the specifications. HTML in, pixels or a tagged PDF out, with no browser, no network and no clock.

dotnet add package RecursiveAI.OneRender.Pdf

A quick look

One call each for a PDF and a PNG. The PDF is tagged from the HTML, and the text is set in bundled fonts, so the output is the same on every machine.

Getting started
Program.csC#
using OneRender.Image;
using OneRender.Pdf;
string html = "<h1>Invoice INV-1042</h1><p>Rendered without a browser.</p>";
File.WriteAllBytes("invoice.pdf", HtmlPdf.ToPdf(html));
var options = new HtmlRenderOptions { Width = 600, Height = 200 };
RgbaImage image = HtmlRender.ToImage(html, options);
File.WriteAllBytes("invoice.png", image.ToPng());
What it does

What it does

Lays out real CSS

Block and inline layout, floats, positioning, flexbox, grid with subgrid, tables, multi-column, and bidirectional text shaped by onefont.

Tagged PDFs from HTML

Headings, lists, tables and alt text become the PDF’s structure, with PDF/UA-1 and PDF/A-2a one option away. @page, margin boxes and page numbers work.

Razor in one call

Render a Razor component to a PDF or an image inside ASP.NET Core, with style sheets, images and fonts served from wwwroot.

Interactive UIs and games

Hit testing, DOM-standard events, focus, scrolling, form controls with text editing, and CSS animations on your own clock. Steady frames allocate nothing.

Accessibility checks without a browser

Lays a page out and hands onehtml’s checker the rendered facts it needs for contrast and target size.

Nothing runs that you didn’t pass in

No JavaScript, no network, no processes and no unsafe code. Your code supplies every style sheet, image and font, and limits are checked before the work they guard.

How it’s checked

Compared with Chrome, element by element

Layout is compared with Chrome for Testing 156 on the same font files. On six document templates, 99.967% of the geometry is within tolerance at both 1280 × 800 and 390 × 844. Web Platform Tests gate each CSS module, and tagged PDFs are validated against PDF/UA-1 with veraPDF.

How the comparison works

The packages

Go further