OptionalbrowserOptionalbrowserBrowser executable. Auto-detected when omitted. browser engine only.
OptionalconvertConvert HTML to PDF yourself, instead of spawning a browser.
import { chromium } from 'playwright';
const convert = async (html: string) => {
const browser = await chromium.launch();
const page = await browser.newPage();
await page.setContent(html, { waitUntil: 'load' });
const pdf = await page.pdf({ printBackground: true });
await browser.close();
return pdf;
};
OptionaldocumentThe kind of document to render. Defaults to invoice (the tax invoice).
proforma, deliveryNote and receipt are printable business documents
rendered from the same data but reported nowhere through Online Számla;
they drop the money detail they should not show and carry a "not a tax
invoice" note instead of the NAV-provenance note. See DocumentType.
OptionalengineWhich engine to use.
native (the default) needs nothing installed. browser follows the
HTML document exactly but requires Chrome, Chromium or Edge.
OptionalenvEnvironment consulted when detecting a browser. Injectable for tests.
OptionalfontReplace Roboto with your own font files.
OptionallanguageDocument language. Hungarian by default, as the law prescribes.
OptionalnoteExtra note printed under the totals, e.g. payment instructions.
OptionalprovenanceState that the document was rendered from reported data.
On by default. An invoice's legal original is whatever the issuer issued; this rendering is a faithful presentation of the reported data, and saying so avoids passing it off as something it is not. Can also be set through the theme.
OptionalsandboxRun the browser with its sandbox. On by default.
The sandbox is what contains a malicious document, and invoice data is
input. It is left on even though that means conversion fails when running
as root — in a container or CI, pass sandbox: false deliberately. The
error message says so, rather than quietly weakening the default for
everybody.
OptionalsearchAbsolute locations probed when detecting a browser, in place of the usual install paths. Injectable for tests: those paths are the host's, so without this a test cannot describe a machine that has no browser.
OptionalthemeBranding and layout: logo, colours, fonts, page setup, footer.
See InvoiceTheme. Anything omitted falls back to a restrained default that prints well in black and white.
OptionaltimeoutGive up after this long. Defaults to 30 000 ms.
Extra arguments passed to the browser.