← Blog
Perfex CRMPHPBranding

Perfex CRM Invoice PDF Template Customization Without Code

Brand your Perfex CRM invoice PDF template without editing core files an update will overwrite: header, footer, cover pages, fonts and table row colours.

Open the last invoice you sent out of Perfex, then open your website in the next tab. If those two things look like they came from the same company, you are in a minority. Most self-hosted installs send a document with the logo dropped into whatever slot the platform gave it, the default typeface, an untouched items table and a footer that says nothing. Your Perfex CRM invoice PDF template is the single most-forwarded asset your business owns - it goes to a finance inbox that has never seen your brand and will never see anything else of yours - and it is usually the least designed thing you produce.

We build and sell the PDF Customizer module for Perfex CRM, and this article uses it as the worked example, so weigh the recommendation with that in mind. The argument about why the default route fails holds whatever you use to fix it.

Why most installs still send a default-looking invoice

Perfex builds its documents server-side. The layout lives in PHP under application/libraries/pdf/, rendered by a bundled HTML-to-PDF library rather than by a browser, and the stock Setup > Settings > PDF tab gives you a font, a page size and four margin values. That is enough to move the logo and not much else.

So the usual route is to edit the files. A developer opens the invoice PDF class, adds a header block, tints the table rows, commits nothing because the install has no version control, and the document looks good for about four months. Then Perfex ships an update.

What happens next is worse than losing the work:

  • A clean overwrite is the good outcome. The file reverts, the branding disappears, and somebody notices when a client asks why the invoice changed.
  • A partial merge is the bad one. The upgrade adds a field or renames a helper, the customised class no longer matches what calls it, and PDF generation throws a 500 on one document type only. Invoices render, credit notes do not, and nobody finds out until a refund needs paperwork.
  • The compounding cost is the real killer. You did not customise one file, you customised six, because proposals, estimates, invoices, credit notes, payments and contracts each generate separately. Every future update becomes a six-way merge that somebody has to be paid to redo.

That is why the branding pass gets done once, breaks, and never gets done again. The install is not un-brandable; the maintenance model is just wrong. Perfex has a module system precisely so that added behaviour lives in its own directory and survives a core upgrade, and presentation is exactly the kind of thing that belongs there rather than in a patched core file.

The four things a client notices on a Perfex CRM invoice PDF template

Nobody on the receiving end audits your line spacing. In practice a recipient registers four things, in this order.

This is the part that reads as “a real company” or “an install with the defaults on”. A useful Perfex CRM PDF header and footer carries the logo, the trading address, and the registration details a business is legally obliged to show on an invoice in its jurisdiction - company number, VAT or tax number, and in several EU countries the registered office.

Two constraints are worth knowing before you open the editor, because the module builds on the platform’s native PDF driver and inherits its limits. Banner images are capped at 110px in height, and footer text is a single line. Both shape your design decisions rather than blocking them:

  • Design a horizontal wordmark, not a stacked lockup. A logo with the mark above the name gets squashed into illegibility at 110px; the same brand set out left-to-right reads fine.
  • Export the artwork at two or three times the display size and let it scale down. A 110px-tall PNG looks acceptable on screen and rough on a printed page.
  • Pick one footer line and make it earn its place. “Acme Ltd, registered in England 01234567. VAT GB123456789.” beats a marketing slogan, because the first version stops your accountant emailing you and the second does not.

2. Cover and closing pages

Extra pages are the difference between a document that looks generated and one that looks written. The module injects cover pages and closing pages into proposals, estimates, invoices, credit notes and contracts, which lets a proposal open on a title page carrying the client’s name and the project title, and close on terms, next steps or a signature block.

Here is where we would tell you not to bother: do not put a two-page brand story in front of a $200-a-month retainer invoice that the same accounts clerk has paid eleven times. Cover pages earn their keep on documents read by someone deciding whether to spend money. On a routine recurring invoice they are friction, and a longer PDF is a slower PDF to generate and a heavier one to email.

3. Fonts and colour

Typeface choice is the cheapest available signal of deliberateness. One caveat specific to server-side PDF rendering: the font has to be available to the renderer, and text metrics are computed at generation time rather than reflowed by a browser, so a face with unusually wide glyphs can push a long line item onto a second row and change your page count. Always regenerate a real document - one with your longest product name and your most talkative client - rather than judging the change on a two-line test invoice.

4. Table row colours

Nobody thinks about the items table until an invoice grows from four lines to sixty. At that point row colours stop being decoration and become readability infrastructure, and the module lets you set them explicitly instead of accepting the default.

A practical number: a zebra stripe below roughly 8% tint disappears entirely on a laser printer, and a lot of finance departments still print. If the document might be printed, test the tint on paper, not on a retina display. Somewhere around 8-12% grey, or a heavily desaturated version of your brand colour, survives both surfaces.

Doing it once instead of six times

The strongest argument for handling this at module level rather than file by file is that Perfex generates six document types, and a customer sees several of them across a single engagement: a proposal, then an estimate, then an invoice, then a receipt. Style them together and the brand holds through the whole sequence instead of appearing on the one document somebody remembered to edit.

DocumentExtra cover/closing pagesWhere the effort pays
ProposalYesHighest return. Read by a decision-maker before money moves.
EstimateYesCover page optional; header and totals styling matter most.
InvoiceYesHeader, footer and row colours. Skip the cover page.
Credit noteYesSame treatment as the invoice - it is a trust document.
Payment receiptStyling onlyThe one everybody forgets. Filed, not read.
ContractYesCover framing and a clean signature page do the work.

The payment receipt deserves a specific mention. It arrives after money has moved, it gets filed in the client’s accounting system, and it is often the last thing you send before a long silence. A receipt carrying the same header as everything else is a small, cheap piece of continuity that costs nothing once the header exists.

What this approach does not fix

Being straight about the boundary. The module is about presentation - headers, footers, injected pages, fonts, colours and table rows through a WYSIWYG editor, no code. It is not a page-layout engine. If your requirement is an arbitrary multi-column magazine layout with rotated type and floating callouts, this is not that, and honestly neither is any HTML-to-PDF pipeline you would enjoy maintaining.

It also does not change what data appears on the document. Which columns exist, how tax is broken out, whether a particular custom field prints - those are different problems with different solutions, and no amount of styling makes a missing purchase-order number appear.

Finally, it is a Perfex module, so it requires Perfex CRM 3.0 or later and installs the standard way: Settings > Modules > Upload, then activate. Setup takes seconds. Deciding what your documents should actually say takes considerably longer, which is the correct ratio.

A one-session branding pass

Block out ninety minutes and work in this order. Doing it out of order means re-testing everything twice.

  1. Gather the assets first. A horizontal logo exported no more than 110px tall, your registered details written out as one line of plain text, and your brand colour as a hex value.
  2. Install and activate. Upload the PDF Customizer module via Settings > Modules > Upload on Perfex 3.0 or later.
  3. Do the header and footer before anything else. They appear on every document type, so getting them right first means every later test renders in its real context.
  4. Generate a live invoice, then print it. Not a test record - your longest, ugliest real invoice. Check the logo edge quality, the footer line, and whether the row tint survived the printer.
  5. Set fonts and row colours, then regenerate that same document. Compare the two side by side, on paper, and watch for line items that have wrapped since the font changed.
  6. Add cover and closing pages to proposals and contracts only. Leave routine invoices and receipts lean.
  7. Open one finished PDF on a phone. A large share of client-side approvals happen on mobile, and a header that works at A4 can be unreadable at five inches.

If you only get through steps 1 to 4, stop there. The header, the footer and a document that prints cleanly account for most of what a client actually registers. Everything after that is refinement.