Downloading a PDF
Admin: Go to Admin → Invoices → [invoice] → Download PDF. The PDF is generated on demand and served as a file download.
Client portal: Go to Client → Invoices → [invoice] → Download PDF. Clients can only download PDFs for their own invoices — the route enforces ownership.
Direct routes:
| Actor | Route |
|---|---|
| Admin | GET /admin/invoices/{id}/pdf |
| Client | GET /client/invoices/{id}/pdf |
PDFs are generated on demand — they are not stored on disk. Each download renders a fresh PDF from the current invoice data.
What the PDF Contains
A generated PDF invoice includes:
- Company logo (if enabled in Settings → Invoice PDF)
- Your company name and address (from Settings → General)
- Client name and billing address
- Invoice number, issue date, and due date
- Line items table — description, quantity, unit price, tax rate, line total
- Subtotal — sum of line items before tax
- Tax total — grouped by tax rate if multiple rates apply
- Grand total — amount due in the invoice currency
- Payment terms block — configurable text (e.g. "Payment due within 14 days")
- Footer block — configurable text (e.g. company registration number, VAT number)
How PDFs Are Generated
Commerce uses barryvdh/laravel-dompdf via the InvoicePdfService class. The PDF is rendered from a Blade template using the dompdf HTML-to-PDF engine.
[!TIP] dompdf renders HTML and CSS, but it does not support all modern CSS features. Flexbox and Grid are partially supported. If you customise the template, test your layout at a few different invoice sizes (few line items vs. many).
Customising the PDF
Go to Admin → Settings → Invoice PDF to configure:
| Setting | Effect |
|---|---|
| Company logo | Uploaded image shown in the top-left corner of the PDF |
| Accent colour | Hex colour used for the header bar and table header row |
| Payment terms | Text block shown below the totals section |
| Footer text | Text shown at the bottom of every page (e.g. registration numbers) |
| Show tax number | Toggle to include your VAT/GST number near the company address |
Changes to these settings take effect on the next PDF generated — there is no need to re-publish existing invoices.
Template Location
The Blade template for the PDF is located at:
resources/views/commerce/invoices/pdf.blade.php
You can modify this file directly to change the layout, fonts, or structure. The template receives the $invoice variable with all relationships (client, lineItems, payments) eager-loaded.
[!WARNING] Modifying
pdf.blade.phpdirectly means your changes may be overwritten on future Commerce updates. Consider copying the template to a versioned location and referencing it fromInvoicePdfServiceif you need a heavily customised layout.
Fonts and Character Support
dompdf uses embedded fonts. The default template uses DejaVu Sans, which supports a broad range of Unicode characters including most European languages, Arabic, and CJK (Chinese, Japanese, Korean) if the dompdf font cache is populated.
If accented characters or non-Latin scripts appear as boxes, run:
php artisan dompdf:build-font-cache
Multi-Page Invoices
dompdf handles page breaks automatically. Invoices with many line items will span multiple pages. The header (company logo, addresses, invoice number) appears only on the first page. The footer text appears on every page.