Watermark for PDF templates

Tags: #<Tag:0x00007f09d6918250>

I would love the idea of having a mark that says PAID when an invoice is set as PAID directly in pdf invoice.

Is it possible?

Thank You

What do you mean? A mark IN the PDF Invoice? -> Template for payed Invoices
A mark in the overwiev? It’s allready there.

Like this in pdf … see the img on the url

1 Like

Ah ok. You can edit the template for paid invoices and insert this as an image, wherever you want.
The path ist “application/views/invoice_templates/pdf”. There you have an “default-paid.pdf”. You can edit it and insert this image.
Better not edit it directly. Rename it and then edit it.


:blush: was about saying same.

Thank’s a lot :slight_smile:

I did this now no
not too perfect but it showed it can be done.

I used the default-paid.php (after making a copy though (see attached) hope it helps.

default-paid.php (12.5 KB)


I just really thought about this and I don’t know if this is a feature we should integrate directly into the app.

Nice really. I also think the merchant should be allowed to customize same just as one would use an official seal. This should help prevent forgery in some way.

The PDF engine supports watermarks. Maybe something can be implemented in this way?!

I know that this is quite old but i have a solution for the watermark text.
Since i was looking also a way to display a watermark on the invoice i started writing the css code and i found out that mPdf doesnt support rgba(r,g,b,a) color in text. No matter what you put as an alpha channel it is always set to 1 => full opacity.
While searching the mPdf documents i found out that it has a function SetWaterMarkText() which suddenly we cant use from our php. But instead of that mPdf also has the “watermarktext” which we can use directly in our php code like this <watermarktext content="Text as watermark" alpha="0.4" />. For this to work we also need to edit the mpdf_helper.php file and add the line $mpdf->showWatermarkText = true; before the WriteHTML() call.
The above will add a 45 degrees rotated text in the whole page as a watermark. Unfortunately this wont work if someone wants to add a watermark at a specific position in the pdf.

I hope that this will help someone else also and give some ideas on the developers to add in the next version, something like “Show Invoice Watermark” and “Watermark Text :” in the invoice settings.


1 Like