
Note that the is placed after the element.
#Custom billing invoices code#
To insert JavaScript code into the HTML template, use the standard HTML DOM methods (getElementById element and innerHTML property).īelow is an example of including element in an HTML template. You need to enclose your JavaScript code within tag. You may need to test-run the workflow to see how the margin values affect the layout of the document. To test the sizes of your header and footer, save the HTML and view it in the Chrome browser.
#Custom billing invoices download#
You can download a header template example and a footer template example and start to build your own templates. To use images in the header or footer, convert them into Base64-encoded strings. Javascript and online fonts or images are not supported in the header and footer templates. Header Template and Footer Template: The header and footer templates are HTML templates.You also need to consider padding above and below the header and footer templates. Ensure that the margin-top is greater than the height of the header template, and the margin-bottom is greater than the height of the footer template.įor example, if your header HTML is 200 px high, you must specify a number larger than 200 for the margin-top, in order for the header HTML to display on the document. See the diagram below for the different parts and margins of a template. Margin Left, Margin Right, Margin Top, and Margin Bottom: Margins are in pixels.The options include Letter, Legal, Tabloid, Ledger, A0, A1, and A2. Paper Size: Select the page size that you want to use.This template is explained in Customize invoice templates using HTML.
#Custom billing invoices pdf#
The maximum size of a PDF file to upload is 4 MB. If the size of the saved PDF is greater than 4 MB, you need to downsize your template accordingly.įor a complete use case and template code examples, see the "Custom Invoice" workflow template under the Invoicing category. You can then select Print and use Save as PDF as the destination. To test the output of your template, save your template as an HTML file and open it in Chrome (version 77.0.x or later). For details about the API operation, see Upload File For Invoice in the API Reference. For each billing document, a maximum of 50 PDF files can be uploaded. The header and footer parts are specified in the Advanced Settings tab.įor PDF generation, the task uses the page.pdf component of the Puppeteer Node library. For attaching PDFs to billing documents, the task uses the Zuora API that uploads files for billing documents. The body part is specified in the Template tab. If Invoice Settlement is enabled, generation of credit memo and debit memo files is also supported.Ĭompared with the Microsoft Word Mail Merge invoice template in Zuora, an HTML template provides more advanced controls as well as more room for customization.Ī valid HTML template should include three parts: body, header, and footer. If Invoice Settlement is not enabled, only generation of invoice files is supported. You can customize your billing document template using HTML tags, CSS, images, JavaScript and Liquid expressions. The custom billing document task generates a billing document PDF file based on an HTML template, and then attaches the generated PDF file to the billing document that is Draft or Posted status.
