CMS Development

TAkçay
Participant

Quote pdf page number

SOLVE

I want to add a page number to the pdf when printed to the Hubspot offer template. I tried the page and counter codes on css but it didn't work. Can you help me?

1 Accepted solution
HubDoPete
Solution
Guide | Gold Partner
Guide | Gold Partner

Quote pdf page number

SOLVE

Hi Tuğba

 

You "can" add page numbers but it takes some work, as they are not an automated feature.

 

Plan your template as a pagination loop with an incrementing page counter and embed your recurring template modules inside the loop. For example, force a cover/summary page as page 1, then add line items to page 2 onward. If you know how many line items you can reliably fit on a page (for example eight) then loop every 8 line items, forcing a page break and incrementing the page counter on each loop.

Then for the page to follow, force a page break and increment the page number for the last page.

 

So it's fairly mechanical, but it also allows you to calculate the expected number of pages based on line item count, so you can print "Page 1 of X"

 

I also upvoted the 'make it automatic' post 🙂

 

best

Pete

 

 

to Loop

View solution in original post

0 Upvotes
5 Replies 5
HubDoPete
Solution
Guide | Gold Partner
Guide | Gold Partner

Quote pdf page number

SOLVE

Hi Tuğba

 

You "can" add page numbers but it takes some work, as they are not an automated feature.

 

Plan your template as a pagination loop with an incrementing page counter and embed your recurring template modules inside the loop. For example, force a cover/summary page as page 1, then add line items to page 2 onward. If you know how many line items you can reliably fit on a page (for example eight) then loop every 8 line items, forcing a page break and incrementing the page counter on each loop.

Then for the page to follow, force a page break and increment the page number for the last page.

 

So it's fairly mechanical, but it also allows you to calculate the expected number of pages based on line item count, so you can print "Page 1 of X"

 

I also upvoted the 'make it automatic' post 🙂

 

best

Pete

 

 

to Loop

0 Upvotes
TAkçay
Participant

Quote pdf page number

SOLVE

Hi Pete,

 

Thank you for your answer.  I'll try to do as you say 😊

HubDoPete
Guide | Gold Partner
Guide | Gold Partner

Quote pdf page number

SOLVE

Here is an example to set up your loop in the main template:

{% for row in LINE_ITEMS|batch(8) %}
{% set pageCount = loop.index %}
{% set TotalPage = LINE_ITEMS|batch(8)|length %}

<div class="sheet cst-page-section loop-pages page-{{ loop.index + 1 }} {% if loop.last %}last-page{% endif %}">

 

Good luck!

 

0 Upvotes
TAkçay
Participant

Quote pdf page number

SOLVE

really thank you for helping me 🙏

0 Upvotes
BérangèreL
Community Manager
Community Manager

Quote pdf page number

SOLVE

Hi @TAkçay, I hope that you are well!

Thank you for asking the Community!

This is not yet a native feature. However, I’ve noticed a similar idea already present in our Ideas Forum: Adding page numbers to Quotes. To contribute, you can upvote the existing idea and share more details about your specific use case in the comments.

I also wanted to invite a couple of subject matter experts to this conversation: Hi @Bryantworks, @HubDoPete and @ChristinaKay do you have suggestions on which code to use to help @TAkçay, please?

If anybody else has anything to add and/or share, please feel free to join in the conversation 🙂

Thanks a lot and have a great day!

Best,
Bérangère


Saviez-vous que la Communauté est disponible en Français ?
Rejoignez les discussions francophones en changeant votre langue dans les paramètres !

Did you know that the Community is available in other languages?
Join regional conversations by changing your language settings!


0 Upvotes