Styling page number string

Hello,

For some reason the page numbering was not working on my install in several versions after it was introduced, but now in v5.5.1 it finally works as I can see it in the footer:

image

I’m not sure I like how it’s styled compared to the rest of the invoice, however, so I went into the Invoice design tool but I can’t get the selector of the page number string, as it just won’t appear in HTML mode… and when it gets printed in PDF, well, I can’t inspect it.

image

I was wondering, is there a selector available for that string, and if so, what is it?

Thanks!

Hi,

@david can you please advise?

@charles not yet unfortunately. There could be a way to change the text if you create a custom label, the key to use is

The current key is as follows

    'pdf_page_info' => 'Page :current of :total',

So you would use the key pdf_page_info

And then insert the string you want, note the place holders :current and :total the the page and total page numbers.

There isn’t a way to style this currently.

Thanks for the info @david, I’ll try customizing with the custom labels for now and I’ll be looking forward a “real” styling option - fingers crossed!

1 Like

@david is there any way to use this key as a variable in the body of an invoice like other variables? For Example if I wanted to have the page number somewhere on the invoice page, can I refer to some variable like $pdf_page_info?

Trying to have a field within my invoice, where it says page … of …

Thanks!

I was hoping for page numbering in a custom Invoice design by throwing in a custom field $variable. Here is a relevant github issue I found, with some discussion on page numbering, apparently there is an unresolved regression from v4 to v5:

Looks like a convoluted way to get page numbers has been found, but it seems to be far from ideal, with drawbacks including a lack of ability to control the styling and placement of the page numbers with HTML & CSS in the invoice design. I am hoping this gets resolved sooner than later.