Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Is it possible to get the current page in the html template?

New Here ,
Jun 07, 2023 Jun 07, 2023

Hi,
I've been looking at the @adobe/pdfservices-node-sdk documentation but I don't see anything related to getting the current page in the HTML.

Is it possible to get it from there? My idea is to make a custom footer and add the current page number along with other information.

TOPICS
How to , Node.js SDK , PDF Services API
590
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Adobe Employee , Jun 08, 2023 Jun 08, 2023

This is not currently possible with the API.

Translate
LEGEND ,
Jun 07, 2023 Jun 07, 2023

It's generally considered that HTML is not divided into pages, but a continuous stream. A conversion of HTML to PDF will be in pages, but that is not a property of the HTML.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jun 08, 2023 Jun 08, 2023

Hi, thanks for the reply

In the mPDF library, these variables {PAGENO}/{nbpg} can be used in the html, which are transformed into: current page / number of total pages. The includesHeaderFooter method of the adobe api generates something similar in the default footer.

That's why I'm asking if it's possible to get that in a custom footer.

Thank you in advance

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jun 08, 2023 Jun 08, 2023

Ah, so it isn't actually a page number for the HTML (which wouldn't mean anything), it's a dynamic reference to the page number it WILL have in the PDF when converted. I see now. I hope someone has a suggestion for you. {nbpg} is interesting. It's convenient, but requires either a complete dummy run just to get the total page count before starting, or going back over the converted pages to stamp them later on... sometimes nice things come at a big cost.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jun 08, 2023 Jun 08, 2023

Correct, it's a dynamic reference. Sorry for my english.

There is an includesHeaderFooter method in the api, but it only adds the default adobe footer



default_footer.png

So just to confirm, the api doesn't allow you to do that in a custom footer? Like this example


custom_footer.png

Thank you in advance

 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Jun 08, 2023 Jun 08, 2023
LATEST

This is not currently possible with the API.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources