Skip to content

Rendering

Render documents as PDF, HTML, or shareable links.

PDF

Render pdftypescript
// title: Render PDF
const pdf = await sdk.invoices.renderPdf(invoice.id);

// With options
const pdfCustom = await sdk.invoices.renderPdf(invoice.id, {
  template: "modern",
  locale: "de",
});

Options: template (modern, classic, minimal), locale (en-US, de-DE, etc).

HTML

For embedding in web apps:

Render htmltypescript
// title: Render HTML
const html = await sdk.invoices.renderHtml(invoice.id);

// Embed in your app
document.getElementById("invoice-preview").innerHTML = html;

Share documents without authentication:

Public linktypescript
// title: Public sharing link
const share = await sdk.invoices.share(invoice.id);

console.log(share.url);
// https://app.spaceinvoices.com/share/abc123...

// Customers can view without login