Variable pageNumber and pageCount

I read that Invoice Ninja supports the variable pageNumber and pageCount. I put both variables in the code. Both variable are not supported. What am I doing wrong?
variable pageNumber and pageCount
I use the last version of Invoice Ninja.
Many Thanks
greetings

1 Like

The variables are designed to be used in the footer text rather than in a custom design,

Thank you.
Will they be supported in the future?

I’m not sure I follow, why not use the variables in the footer?

They did not work in the footer too.
Look at the picture below right (opening post)

Have you tried adding the variables in the default footer at the bottom of Settings > Invoice Settings

Hi Hillel:

Do the variables need to be escaped somehow? Putting

$pageNumber of $pageCount

into the footer (at Settings/Invoice_Settings/Defaults/Invoice_Footer) displays that literal text on the invoice

Adding $pageNumber and/or $pageCount to the footer code (in custom design mode) doesn’t work either – but that makes sense as PDFMake is a JS program and $pageNumber and $pageCount are, presumably, PHP variables.

Thanks for any insight.

This is on 4.5.9, self hosted.

I’m not sure, it seems to work in my test.

I just copied the help text on Settings/Invoice_Settings/Defaults/Invoice_Footer into the footer field, clicked save and then saw ‘1 and 1’ on a test invoice.

Hi Hillel:

You mention: “I just copied the help text on Settings/Invoice_Settings/Defaults/Invoice_Footer”

Where at Settings/Invoice_Settings/Defaults/Invoice_Footer do you see help text?

Further up the page (i.e. Settings/Invoice_Settings/Generated_Numbers/Invoice_Number) I see some help text for the “pattern,” but nowhere else do I see relevant help text.

Pattern requires squiggly brackets (i.e. { and } ) for variables. They work in “pattern” but not in the footer (I had tried that too).

Thanks in advance for any further insights.

At the bottom of the page on the “Invoice Footer” tab it says:

Use $pageNumber and $pageCount to display the page information.

Hi Hillel:

At the bottom of the page on the “Invoice Footer” tab it says:

Use $pageNumber and $pageCount to display the page information.

I do not see that at the bottom of my page. I am on 4.5.9 self hosted.

I have also tried various other permutations including:
adding squiggly brackets, for example {$pageNumber} of {$pageCount}
adding periods (some other variables have them), for example $page.Number of $page.Count

The first shows the literal string, the second displays only the “of” as the variables do not exist with the period . . .

Thanks in advance for any further insight(s).

That’s odd, can you post a screenshot?

post a screenshot?

OK, here you go.

The linked image shows no help text you describe (under the “Invoice Footer” tab).

You will also note I have the simplest possible variable entered to test: “$pageNumber” – with no additional text or variables. Even a single variable like this will show the literal text “$pageNumber” (without the quotes) on a generated invoice.

Thanks in advance for any further help or ideas.

I’ve checked the code, it looks like this feature requires a white label license.

Sorry for the trouble!

it looks like this feature requires a white label license

Aha!!

Here I thought you and I were speaking different languages. :wink:

Would you consider removing this from the White Label restrictions? For the moment, at least, I don’t mind plugging Invoice Ninja, but my invoices need pagination!

Also, is there a description somewhere which demonstrates all features affected by White Labeling?

One more White Label question: when purchased, the Invoice Ninja logo is also removed from I-N generated web pages for clients. Can that logo then be replaced with a different logo?

I think the problem is this feature conflicts with the branding added to some of the designs. If possible we’ll try to correct it in v2.

This is the only affected feature that I’m aware of.

You’d need to modify the code to do it but it’s ok by the license to add your logo in the client portal, we plan to support it natively with v2.

I was also looking for how to add the pagination of the footers because the variables did not work.

Until this is repaired is there a PHP or JS file that I could modify manually so that the footer interprets the pagination variables correctly ?

Regards :slight_smile:

Sorry, this won’t be fixed. The feature requires a white label license.

Hello there.
I have the latest version of dockerized IN - v5.1.19-C44 with white license.

both variables $pageNumber and $pageCount are not rendered in invoice.
is that know behavior? are there any tricks?

@david, @ben is this supported in v5?