PDFs and fonts
How invoice and quote PDFs are built, what you can control, and how to install the optional fonts for Chinese, Japanese and Korean text.
Invoices and quotes can be downloaded or emailed as PDFs. They are built inside Tidemark Billing, with no outside service or extra program needed, so they work on shared hosting. This article covers what goes on a PDF and how to print Chinese, Japanese and Korean text.
Where PDFs appear#
- Staff: the PDF button on an invoice or quote page.
- Clients: Download PDF on an invoice or quote in the client area, and on the public link from an email. For a paid invoice the button reads Download receipt (PDF).
- Email: new invoice, reminder and payment-received emails attach the invoice PDF when Attach the PDF to invoice emails is on in Settings → Billing. If a PDF cannot be built, the email is still sent without it.
The file is named after the document number, such as INV-00012.pdf.
What is on a PDF#
- Your business name, address, contact email and tax or VAT number from Settings → General, and your logo if you set a Logo URL. The logo can be a PNG, JPEG, GIF, SVG or WebP file up to 1 MB.
- Your brand colour.
- A status mark on invoices: Paid, Void, Uncollectible, Draft or Overdue.
- Notes and terms.
- On unpaid invoices, a Pay online box with the invoice link, and your Payment instructions from Settings → Billing unless the invoice is paid or void.
Paper size#
PDF paper size in Settings → Billing can be Automatic (by client country), A4 or US Letter. Automatic uses US Letter for clients in the US, Canada, Mexico, Chile, Colombia, Venezuela, the Philippines, Costa Rica, Guatemala, Panama and the Dominican Republic, and A4 for everyone else.
Chinese, Japanese and Korean text#
The built-in font covers Latin, Greek and Cyrillic. It has no Chinese, Japanese or Korean characters, which would print as empty boxes. You can install free Noto Sans font packs to fix that.
When an invoice or quote contains such text and no pack is installed, its page shows a notice with a link to the font settings. The text checked is your business details, payment instructions, the client's name and address, notes, terms, title and line descriptions. The PDF is still built, with boxes where the characters should be, and a warning is written to the log.
Install from the admin area#
Only administrators can install fonts.
- Go to Settings → System and find PDF fonts for Chinese, Japanese and Korean.
- Click Install all font packs (shown while no pack is installed) for Simplified Chinese, Japanese and Korean together, or click Install next to a single pack. Traditional Chinese is only installed on its own.
- Wait for the download to finish. A pack is about 6 to 10 MB.
Remove next to an installed pack uninstalls it.
Install from the command line#
php artisan billing:fonts:install # Simplified Chinese, Japanese and Korean (about 22 MB)
php artisan billing:fonts:install --pack=tc # add Traditional Chinese (about 7 MB)
php artisan billing:fonts:install --remove # remove all packs
php artisan billing:fonts:install --pack=jp --remove
How it works#
- The packs are Google's Noto Sans (SIL Open Font License) in the Regular weight: Simplified Chinese, Traditional Chinese, Japanese and Korean. They are downloaded once from a public CDN (jsDelivr), so the server needs outbound HTTPS for that moment. Each file is checked against a fixed checksum and size, and discarded if either differs.
- They are stored under
storage/app/dompdf/fonts. Onlystorage/needs to be writable. Nothing is added to the release package. - A PDF without Chinese, Japanese or Korean text is built exactly as before. Otherwise each run of those characters is set in a suitable pack. Kana use the Japanese pack, hangul the Korean one, and ideographs follow the text around them, falling back to Simplified Chinese. Characters one pack lacks are sent to a pack that has them.
- PDFs embed only the characters they use, so they stay small.
Limits#
- Chinese, Japanese and Korean text is never bold. The packs are Regular only, so bold text in those scripts prints at regular weight. Latin text stays bold.
- Emoji and rare symbols are not in these fonts.
- Embedding a font takes about 75 MB of extra PHP memory. Tidemark Billing tries to raise the memory limit to 512M for these documents. If the limit stays below 192M, it builds the PDF without the fonts and logs a warning instead of failing. Ask your host to raise
memory_limitto 256M or more if you need these scripts.