Server rendering
Make PDF and Excel files without a browser in Node.js, Deno or Bun with renderPdf and renderXlsx for batch jobs and e-mail attachments.
renderPdf and renderXlsx lay out and write files without a browser (Node, Deno, Bun, workers). Text is measured with the TrueType fonts that the PDF embeds, so line breaks match. Use it for batch jobs, scheduled reports and e-mail attachments.
// Node 20+, Deno or Bun — no browser needed
import { writeFile } from 'node:fs/promises';
import { loadFonts, renderPdf, renderXlsx } from '@freereportjs/core';
const fonts = await loadFonts(['Nanum Gothic']); // TTF bytes (or read your own files)
const pdf = await renderPdf(definition, { rows }, { fonts, params: { user: 'batch' } });
await writeFile('sales.pdf', pdf);
await writeFile('sales.xlsx', await renderXlsx(definition, { rows }, { fonts, mode: 'form' }));