A receipt is not a small invoice. It is a different page size, a different typeface and a different set of lines, which is why shrinking an A4 invoice never looks right. This template renders an 80mm receipt from a Make scenario, the width a thermal printer expects.
600 free requests / month, no credit card
// live preview
The page size is set to 80 by 160 millimetres, which is why the output looks like a till roll. Add lines to the JSON and the page grows with them.
// the workflow
The scenario is short on purpose: the payment event already carries the lines, so the only work is rendering them. Set the page size on the module, otherwise the receipt is drawn on A4 with a lot of white space below it.
{
"pdfWidthMm": 80,
"pdfHeightMm": 160
}// step by step
Add the module to a scenario and create a connection with the API key from your workspace. The getting started page walks through it once, and every later scenario reuses the connection.
Pick the HTML to PDF module and paste the template. The monospace font and the dashed rules are plain CSS, so nothing has to be configured on the module itself.
Set pdfWidthMm to 80. The height is a starting point, not a limit: a longer list of lines pushes the page out rather than being cut off.
Most payment providers send the basket as an array. Map it straight into the lines property and let the loop in the template draw the rows.
Email the file to the customer, or push it to a print service. Because it is a plain PDF at roll width, a thermal printer handles it without a driver specific layout.
// html template
Three choices do most of the work: a monospace font so the columns line up, dashed rules instead of borders, and a narrow page.
body {
width: 80mm;
padding: 6mm 5mm;
font-family: "SF Mono", Menlo, Consolas, monospace;
font-size: 9pt;
}
.rule { border: 0; border-top: 1px dashed #999; margin: 8px 0; }<tr><td class="muted">Net</td><td class="num">{{ net }}</td></tr>
<tr><td class="muted">VAT {{ vatRate }}%</td><td class="num">{{ vat }}</td></tr>
<tr class="grand"><td>Total {{ currency }}</td><td class="num">{{ total }}</td></tr>Calculate the net and VAT figures in the scenario rather than in the template. A receipt that disagrees with the payment record by a cent is worse than one that is plain.
One HTML to PDF module turns the invoice data in your scenario into a finished document. Editable template, dynamic line items, output straight to Drive or email.
Turn an approved request into a purchase order PDF your supplier can work from, with supplier references, a required by date and the approver on the document.
Create a workspace, connect the API key in Make, and set the module to 80mm.