@repdf/core
v0.14.0
Published
Core components of repdf
Readme
@repdf/core
Build PDFs as React components. This package has the components and rendering functions:
Document,Image,PageBreakcomponentsrender(node)— React tree → complete HTML documentrenderPdf(node, { backend, pdf })— production PDF generation with pluggable engines:@repdf/core/pdf/puppeteer— local Chrome or a remote browser endpoint (needspuppeteer-core)@repdf/core/pdf/cloudflare— Cloudflare Browser Rendering API@repdf/core/pdf/gotenberg— a Gotenberg instance
PreviewConfig<typeof Component>— type for the dev-onlypreviewexport (page setup + sample data)
For live-preview development install @repdf/preview and run repdf dev. Style templates with Tailwind via @repdf/tailwind-v4 or @repdf/tailwind-v3.
import { renderPdf } from "@repdf/core";
import { puppeteerBackend } from "@repdf/core/pdf/puppeteer";
import InvoicePdf, { preview } from "./pdfs/InvoicePdf";
const pdf = await renderPdf(<InvoicePdf invoiceNumber="INV-0042" />, {
backend: puppeteerBackend(),
pdf: preview.pdf,
});Full documentation: https://github.com/repdf-labs/repdf-init#readme
