HTML to PDF.A real PDF.

Generate native, selectable, searchable PDFs from HTML in the browser. Powered by Zig, WebAssembly, and a typed TypeScript API—not a screenshot pipeline.

npm install @imggion/html2realpdf
OUTPUT_PREVIEW.PDF
ACME.STUDIOINVOICE

Invoice #0042 · Jul 15, 2026

Design systems
that ship.

Selectable text. Search it, copy it, feed it to your tools. No OCR required.

Design engineering$4,800PDF implementation$2,400
Total$7,200
pay.acme.example/inv-0042
Page 1 of 1Text layer: native

Try the difference yourself.

One three-page analytics report, two PDF engines. Download both files or preview every page here, then test the text, tables, and vector charts.

PDF_OUTPUT_LAB.EXE
NORTHSTAR_ANALYTICS.HTMLsame input
HTML2REALPDF · REPORT SYSTEMNORTHSTAR_Q2_2026.PDFPAGE 01

QUARTERLY BUSINESS REVIEW

Northstar Commerce Analytics

Executive performance report — Q2 2026

Key business metrics
NET REVENUE€4.82M+18.4% YoYGROSS MARGIN64.2%+3.1 ptsACTIVE CUSTOMERS28,640+11.8%CHURN2.7%+0.3 pts

Revenue trend

Q3 25Q4 25Q1 26Q2 26€3.42M€3.77M€4.11M€4.82M

Executive insight: Revenue acceleration was driven by enterprise expansion and a 9% increase in average order value.

HTML2REALPDF · NATIVE DOCUMENT01 / 03
HTML2REALPDF · REPORT SYSTEMNORTHSTAR_Q2_2026.PDFPAGE 02

Regional performance

Revenue and margin by region
RegionRevenueYoY growthGross marginSignal
United Kingdom€1.54M+22.6%66.8%Strong
DACH€1.21M+19.4%65.1%Strong
France€0.86M+13.2%62.7%Stable
Southern Europe€0.71M+8.1%59.9%Watch
Nordics€0.50M+16.7%64.5%Stable

Customer mix

Enterprise 45%Mid-market 32%SMB 15%Enterprise expansion revenue increased 28% quarter over quarter.Remaining 8%: partners and marketplace channels.
HTML2REALPDF · NATIVE DOCUMENT02 / 03
HTML2REALPDF · REPORT SYSTEMNORTHSTAR_Q2_2026.PDFPAGE 03

Appendix and methodology

Revenue recognition: Net revenue excludes VAT, refunds, marketplace fees, and promotional credits. Subscription revenue is recognized daily over the contracted service period.

Customer definitions: Active customers completed at least one paid transaction during the trailing 90-day period. Churn represents customers becoming inactive during the quarter divided by active customers at quarter start.

Data quality: Figures reconcile to the management ledger as of 8 July 2026. Currency conversion uses the European Central Bank monthly average rate for each transaction month.

Metric sources and ownership
MetricSourceRefresh cadenceOwner
Revenue and marginFinance warehouseDailyFinance Operations
Customer activityProduct analyticsHourlyData Platform
Regional attributionBilling profileDailyCommercial Analytics
TRY THIS IN THE PDFSelect “Gross margin”, copy €4.82M, or search for “Southern Europe”.
HTML2REALPDF · NATIVE DOCUMENT03 / 03

Screenshot PDF

Real PDF

ReadyRuns locally in your browser

A PDF should be a document, not a picture of one.

Canvas-based HTML-to-PDF tools flatten the page into pixels. html2realpdf preserves the parts that make PDF useful: text, links, fonts, layout, and supported vector graphics.

SCREENSHOT_PDF.JPG×
RASTER PIPELINE

Looks like text.

But the page is a large image. Selection, search, copy, and machine reading need extra work.

REAL_DOCUMENT.PDF
NATIVE PDF PIPELINE
TEXT STAYS SELECTABLE

Works like text.

Unicode mappings keep content searchable and copyable. Supported graphics remain vectors.

Native PDF vs. screenshot PDF

The visual difference can be subtle at 100%. The document-model difference is not.

OUTPUT_PROPERTIES
CapabilityScreenshot PDFhtml2realpdf
Text modelOne bitmap per page Native PDF text
Select & copyNot available Yes
SearchNeeds OCR Built in
LinksVisual only PDF annotations
Supported graphicsRasterized Native vectors
ZoomPixels get softer Text stays sharp

Optimized for everything

In one deterministic 30-page stress-report run, html2realpdf produced a smaller native PDF and completed faster than html2pdf.js.

See benchmark details
33.1%faster first PDF
34.5%faster warm render
85.8%smaller file

Recorded project benchmark, not a universal performance guarantee. Results vary with content, browser, and hardware.

One element in. One real PDF out.

Install the package, pass an HTML string or mounted DOM element, then download the result. Release the document when you are done.

  1. 1
    Install

    Use npm, pnpm, Yarn, or Bun.

  2. 2
    Render

    Pass HTML, an element, or a framework ref.

  3. 3
    Download

    Save, preview, or get the PDF bytes.

QUICK_START.TS
import { renderPdf } from "@imggion/html2realpdf";

const invoice = document.querySelector("#invoice");
if (!invoice) {
  throw new Error("Invoice not found");
}

const pdf = await renderPdf(invoice);
try {
  pdf.download("invoice.pdf");
} finally {
  pdf.dispose();
}
HTML2PDF_COMPAT.TS
import html2pdf from "@imggion/html2realpdf";

html2pdf()
  .from(document.querySelector("#report"))
  .save("report.pdf");

Use the HTML you already have.

A browser-first HTML-to-PDF library for the documents web applications generate every day.

01

Invoices

Selectable totals, searchable line items, and clickable payment links.

02

Reports

Native text, vector charts, tables, headers, footers, and page numbers.

03

Tickets

Compact browser-generated PDFs with copyable references and live links.

04

Letters

Embedded font subsets and predictable A4 or Letter page geometry.

05

Slides

Landscape pages with vector graphics that stay crisp at every zoom level.

06

Documents

HTML strings, DOM elements, React refs, and Vue template refs.

RENDER_PIPELINE.SYS
INPUTHTML + CSSstring · element · ref
ENGINEZig + WASMlayout · paginate · write
OUTPUTNative PDFtext · links · vectors

Browser-first, framework-agnostic.

TypeScript handles the DOM boundary and API. WebAssembly runs the Zig layout and PDF writer. The result stays portable across plain JavaScript, React, Vue, and other browser frameworks.

Explore the CSS support matrix

Questions, answered plainly.

Technical claims on this page follow the current repository and public support matrix.

01What makes html2realpdf different from html2pdf.js?

html2pdf.js captures HTML through html2canvas and places the resulting image into a PDF. html2realpdf writes native PDF text, link annotations, embedded font subsets, and supported vector graphics instead of turning the whole page into a screenshot.

02Does HTML-to-PDF generation happen in the browser?

Yes. The Zig renderer is compiled to WebAssembly and runs client-side in modern browsers. Your application can generate and download the PDF without sending document content to a conversion server.

03Can I use it with React or Vue?

Yes. html2realpdf works at the DOM boundary. Pass a mounted DOM element, a React-shaped ref, a Vue template ref value, or an HTML string to the renderer.

04Is there a migration path from html2pdf.js?

Yes. The default export provides an html2pdf.js-style chain with familiar methods such as from(), set(), save(), output(), and toPdf(). Raster-only stages such as html2canvas, image output, and whole-page canvas output fail explicitly.

05Which CSS features are supported?

The versioned CSS profiles cover document layout, pagination, tables, Flexbox, Grid, positioned layout, backgrounds, shadows, transforms, and supported SVG. The public CSS support matrix is the source of truth for exact coverage and current limits.

06Does it claim full PDF/UA compliance?

No. The current release provides machine-readable text and accessible preview controls, but it does not claim PDF/UA or fully tagged PDF compliance.

Stop shipping screenshots as documents.

Open source. MIT licensed. Available on npm.