Copy

html2realpdf documentation

Render selectable PDF documents from HTML in a browser.

ON_THIS_PAGE
  1. Start here
  2. Choose an API
  3. Input and output
  4. Read by task
  5. LLM index

html2realpdf converts an HTML string or mounted element into PDF bytes. The public JavaScript package calls a Zig renderer compiled to WebAssembly.

Start here

  1. Install the package.
  2. Render your first PDF.
  3. Use it in Next.js.
  4. Review the public API.

Choose an API

APIUse it when
renderPdfYou need a direct render with the package default Worker renderer.
createRendererYou render more than once, register fonts, choose the execution backend, or need explicit renderer disposal.
html2pdfYou are moving a supported PDF workflow from html2pdf.js.

Every successful render returns a PdfDocument. Export or download its bytes, then call dispose().

Input and output

The input can be an HTML string, a mounted Element, or a ref-shaped object with a current element. Mounted elements preserve computed styles and live browser state.

The output contains PDF bytes, a page count, and structured diagnostics. Supported text, links, and vector graphics remain native PDF content.

Read by task

LLM index

Use the LLM documentation index to give an agent the complete documentation tree, page URLs, and descriptions in a compact text file.

ON_THIS_PAGE
  1. Start here
  2. Choose an API
  3. Input and output
  4. Read by task
  5. LLM index
html2realpdf documentationCopyright © Imggion
DOCUMENTATION_TREE