CustomJS: HTML to PDF, PNG & Merge icon

CustomJS: HTML to PDF, PNG & Merge

All-in-one toolkit for PDF, HTML, JSON and file conversions

PDF → Generate Invoice

AI-generated

Summary

Generates an invoice PDF from issuer and recipient details and invoice items, using the selected invoice template. Sends the data to the CustomJS API and returns the generated PDF as binary data.

Inputs

  • PDF Template (required) — Selects the invoice template; the only available option is Template 1 (EN).
  • Issuer — Company name and address to include as sender information.
  • Recipient — Customer name and address to include as recipient information.
  • Items Input Mode — The UI offers Define Manually or Use JSON Input. The implementation reads Items JSON regardless of this selection.
  • Items JSON — JSON array of invoice items, such as objects with description, quantity, and unitPrice. The default is one item with quantity 2 and unit price 50. Invalid JSON strings cause parsing to fail.
  • Output Filename — Filename for the generated PDF; defaults to output.pdf in the UI.

Output shape

One item per input item, containing the original input JSON and the generated PDF in binary property data.

Each result is paired with its corresponding input item. If the API returns no data or an empty buffer, the result contains the original JSON but no binary property. Uses the CustomJS API credential.

Links

Discussion