Skip to content
Shahid Malla

WHMCS Invoice Template Customization: Files, Logo, PDF, Settings

The WHMCS invoice template checked against the official docs: viewinvoice.tpl and invoicepdf.tpl, the logo, Pay To Text, child themes, numbering, proforma invoices, tax IDs, custom fields and testing.

· Published · 8 min read
On this page (7 sections)

WHMCS invoice template customization starts with two files in the active system theme: viewinvoice.tpl for the invoice a client sees on screen and invoicepdf.tpl for the PDF invoice. Change the logo, company details, numbering and tax ID in settings first. For layout changes, copy both files into a child theme, so a WHMCS update does not overwrite your work.

Which files produce the WHMCS invoice and the PDF invoice?

Two files in the folder of the active system theme produce them, with optional header and footer files for the PDF. The Custom PDF Invoices page lists them:

  • viewinvoice.tpl is the invoice a client opens in the browser.
  • invoicepdf.tpl is the PDF invoice. It is a PHP template that builds the page with the TCPDF library, so the documentation says you need a basic working knowledge of PHP to edit it.
  • invoicepdfheader.tpl and invoicepdffooter.tpl are optional. If they exist in the same directory as invoicepdf.tpl, WHMCS includes them on every page of the PDF and passes them the same variables.
  • quotepdf.tpl, quotepdfheader.tpl and quotepdffooter.tpl do the same for quotes.

This applies to self-hosted installs. The documentation says WHMCS Cloud does not currently support this method.

How do you change the WHMCS invoice logo and company details?

Most of it is a setting, and no template has to change. The logo has two sources. Logo URL, in the General tab at Configuration > System Settings > General Settings, is the image that appears in email messages and on invoices. The PDF is different: its logo is a file named logo.png or logo.jpg in /assets/img/. Both are covered in Customize Your Logo and the PDF page. I point both at the same image.

What you want to changeWhere it is changedSurvives updates?
Logo in emails and on invoicesLogo URL, General tab of General SettingsYes, it is a setting
Logo on the PDFlogo.png or logo.jpg in /assets/img/Yes, but confirm the file is still there afterwards
Logo width on the PDFThe logo line near the top of invoicepdf.tpl. Its last number, 75 by default, is the width.Only if the file is in a child theme
Company nameCompany Name, General tabYes
Company address blockPay To Text, General tabYes
Your tax or VAT numberTax/VAT ID Number, General Settings tab of Tax ConfigurationYes
A client's tax ID or another client fieldShow on Invoice, on the custom fieldYes
Paper size and font of the PDFPDF Paper Size and PDF Font Family, Invoices tab of General SettingsYes
Label wording, and the PDF file name ($_LANG['invoicefilename'])A language override file such as /lang/overrides/english.phpYes. Files edited directly in /lang are overwritten.
Layout of the on-screen invoiceviewinvoice.tplOnly if the file is in a child theme
Layout of the PDF, or a note on every pageinvoicepdf.tpl, invoicepdffooter.tplOnly if the file is in a child theme

Two font notes from the documentation: Helvetica produces smaller PDF files but suits only standard Latin characters, and Dejavusans supports languages such as Czech, Russian, Arabic and Persian.

How do you customize the WHMCS invoice template so an update does not overwrite it?

Put the files you change in a child theme and leave the parent theme alone. The developer documentation's Child Themes page recommends this for customizing the themes that ship with WHMCS. A child theme is a new folder in /templates with a theme.yaml that names the parent, and any file you add to it overrides the same file in the parent.

  1. Create the child theme. My WHMCS theme structure guide has the folder layout and the theme.yaml format.
  2. Copy viewinvoice.tpl and invoicepdf.tpl from the parent, for example templates/twenty-one/, into the child. Edit the copies.
  3. Create invoicepdffooter.tpl or invoicepdfheader.tpl next to your invoicepdf.tpl if you want one.
  4. Preview with ?systpl=mytheme on a Client Area URL. Then select the theme under System Theme in the General tab and check the PDF again.

The cost is that a copied file no longer changes when the parent does. After each WHMCS update, compare your copies with the new parent files.

Where are the invoice numbering, proforma and tax ID settings?

They are split between two pages: the Invoices tab at Configuration > System Settings > General Settings, and Configuration > System Settings > Tax Configuration.

SettingWhereWhat it does
Invoice Starting #Invoices tabSets the number of the next invoice. Enter only a number higher than the latest invoice. The field is empty again after saving, which is normal.
Custom Invoice Numbering, Custom Invoice Numbering Format, Next Invoice NumberTax Configuration, General Settings tabA format such as INV-{YEAR}-{NUMBER}. The tags are {NUMBER}, {YEAR}, {MONTH} and {DAY}. Invoices that already exist keep their numbers.
Enable Proforma InvoicingInvoices tabInvoices display Proforma Invoice unless their status is Paid, when they display Invoice. It requires Sequential Paid Invoice Numbering.
Sequential Invoice Number Format, Next Paid Invoice NumberInvoices tab, and the VAT Settings tab of Tax ConfigurationThe separate number an invoice receives when it is paid. Auto Reset Numbering in VAT Settings restarts it never, monthly or annually.
Tax/VAT ID NumberTax Configuration, General Settings tabYour tax ID, shown under the company address on Client Area and PDF invoices.
Store Client Data SnapshotInvoices tabKeeps the client's name, address and custom field values as they were when the invoice was created.
Enable PDF InvoicesInvoices tabAttaches the PDF to invoice emails.

The documented steps for custom numbering and for sequential paid numbering both begin by enabling Tax Support in Tax Configuration.

For a custom field, tick Show on Invoice on the field at Configuration > System Settings > Custom Fields. Client custom fields then print under the name and address, and product custom fields print in the line item description. With Store Client Data Snapshot on, invoices that already exist do not pick up a new field.

A footer note has three routes, depending on what it says:

  • Payment instructions. The Bank Transfer and Mail In Payment gateways display their instructions on invoices. Edit them at Configuration > System Settings > Payment Gateways.
  • The same note on every PDF page. Create invoicepdffooter.tpl. Company registration details and payment terms fit here.
  • A note on one invoice. Use the Notes tab of that invoice. The PDF template receives it as $notes.

The documented variables in invoicepdf.tpl include $invoicenum, $datecreated, $duedate, $clientsdetails, $customfields, $invoiceitems, $subtotal, $tax, $total, $companyname and $companyaddress.

How do you test the template with a sample invoice?

Create a draft invoice for a test client and check the on-screen and PDF versions before any customer sees them. I do this on a staging copy.

  1. In the test client's Summary tab click Create Invoice, or use the + icon and New Invoice. Add line items, one with a long description, and enough rows to reach a second page.
  2. Click Publish, not Publish & Send Email, so no email goes out.
  3. Open the invoice in the Client Area as that client and download the PDF. Check the logo, Pay To text, tax ID, custom fields, number and totals in both versions.
  4. Add a payment and look again. With proforma invoicing on, the title and the number should change.
  5. Repeat for a client with accented or non-Latin characters in the name, a taxed client and a client in a second currency.

Invoices become immutable once they leave Draft status, so keep test invoices on test clients. Also open an older paid invoice and confirm it still reads correctly.

What can go wrong when you customize WHMCS invoices?

The usual failures are a PDF that will not render and edits that vanish after an update. The first five rows are from the Troubleshooting Invoices page.

What you seeCause
TCPDF ERROR: [Image] Unable to get the size of the imageThe server cannot load the logo image by URL with cURL, for example because of a firewall. Fix that, or use a relative path to the image in invoicepdf.tpl.
Maximum execution time ... exceeded in tcpdf.phpPossibly a high-resolution logo image in the PDF.
Letters render as question marks in the PDFThe PDF font does not support those characters. Dejavusans, under PDF Font Family, covers more languages.
An invoice shows unexpected client detailsStore Client Data Snapshot is on, or the client has a billing contact.
Duplicate entry '2147483647' for key 'tblinvoices.PRIMARY'Invoice Starting # was set higher than MySQL can hold.
Your layout is gone after an updateThe files were edited inside the parent theme.
  • A PHP mistake breaks every PDF. That includes the PDFs attached to invoice emails. Test before you switch themes.
  • Numbering is hard to undo. The documentation says to only increase Next Invoice Number, never decrease it. It also notes that some accounting practices, particularly for EU-based companies, require sequential numbers on paid invoices. The rules differ by country, so agree the format with your accountant first.
  • Hard-coded text. A currency symbol or address typed into a template is wrong for some clients. My WHMCS multi currency setup guide covers invoices per currency.

Invoice and PDF template changes are part of my WHMCS theme customization work, alongside my other WHMCS services. I start with a free scoping call of about 30 minutes and send a written quote within one business day.

Last reviewed 10 October 2026. Disclosure: I am a freelance WHMCS developer and I sell WHMCS theme and invoice template customization, so I am not neutral. I am CTO at ElySpace, a developer at Marmaids LLC, and founder of WHMCSPilot, which sells WHMCS themes, and MagizAI. File names, settings and error messages are from the WHMCS 9.0 documentation and developers.whmcs.com as I read them on that date.

Share this article

Shahid Malla

Written by

Shahid Malla

Freelance WHMCS developer and hosting infrastructure engineer with 13+ years of client work. CTO at ElySpace, developer at Marmaids LLC, and founder of WHMCSPilot and MagizAI.

Got a project like this?

Tell me what you need - I'll send a real quote within 24 hours.