Add some text to the bottom of each invoice's page except the first page


First off thank you very much Kovah and team for such a fantastic piece of open source software.

I’m setting up IP for the first time and am almost finished. There is one thing left that I am really struggling with.

I would like to add some text asking for a signature on the bottom of each page of an invoice pdf. The difficult part is that I don’t want it to appear on the bottom of the first page.

So show on bottom of:
Page 1: No
Page 2: Yes
Page 3: Yes etc

I saw that IP uses “:nth-child” CSS in templates.css to change the colour of each row in the table with class “item-table”.

So I tried adding this in the PDF Footer box in the settings:

<div class="invoice-signature-footer">
<table class="sign-footer">
<td>Customer Signature: ...........................</td>
<td>ABC Signature: ................................</td>
<td>Date: </td>
<td>Date: </td>
<td colspan="2" align="right">Page: {PAGENO} of {nb}</td>

And then adding this between <style> tags in the <head> of my custom pdf template for my invoices.

body div.invoice-signature-footer:nth-child(1){
          display: none;

But I couldn’t get it to work :’(

Please help…


@Kovah or anyone else have any ideas about this? I feel like it should be something simple, but I just can’t figure out how to do this.

Any help will be greatly appreciated.


Would greatly appreciate any help with this. Still haven’t been able to figure this out or find a solution… @Kovah @Pitma Any other clever people know how to do this??


Thanks deputy, I tried this and had the same problem. I would really like to hide a DIV tag on the first AND last pages of my invoices :confused:

I hope someone can come up with a solution to help us both.



I have tried adding a basic html table in my php invoice pdf template. Using the same CSS styling used in template.css for the table with class “item-table”, I was able to change the background colour. However, when I try to do this for <div>, <p> <h> tags I can’t get it to work?

It seems that in InvoicePlane you can only use :nth-child() with tables?

@samful Please let me know if you get any closer and I will do the same.

Really hope to be able to get this working.

PS I am using the same approach as my initial support comment. I am adding the div stuff to PDF Footer in settings menu and then adding the CSS in between style tags in the head of my custom php invoice template.


@deputy I have been looking for a solution, but I don’t think I am going to be able to find one…

According to mpdf ( nth-child can only be used for TR, TD and TH tags. I really thought that using this nth-child was the solution, but my HTML and CSS knowledge is not good enough to work out how to solve our problem.

I understand we have the same problem and we want to hide the first and last instance of a table, but I can’t think how to do it…I hope @Kovah or someone can help us, they may be our only chance :cry:


@samful Well that explains why :nth-child() isn’t working on my divs :-(. So I guess we can’t get this to work with that idea. But is there another way to achieve this?

I agree our only chance is @Kovah, or @Pitma unless there are any other clever people reading this…


Hi there, (a) SmaRTeY here :hand_splayed:

put in the PDF footer block of the System Invoice Settings page the following code:

<div class="page-hide-{PAGENO}">{PAGENO} of {nb}</div>

Then find the file called “custom-pdf.css” it should be in this folder: /assets/default/css
Here you add the class which is mentioned above and tagged by the page number.
You almost answered your own question, it was fun taking up the challenge! :sunglasses:

Code to add in CSS file:
/* Hiding content in PDF Footer block based on pagenr. in PDF */ .page-hide-1 { display:none; }

Let me know if it works for you, it works for me…

Best regards,


@smartey wow I agree you are a smartey! Such a simple perfect solution. How did I miss that?

Anyway thank you so much!! I’m sure this will be helpful to others too.


why not using something like “if {PAGENO} is not 1 print this info”?


You’re very welcome deputy, nice to be able to help out :slight_smile: