Use PDIs? Take our 5-minute survey to help shape the PDI roadmap.

How to generate page number in the pdf through "Generate PDF" button on Impact analysis table(BCM)

sunil maddheshi
Tera Guru

Hey everyone, We have OOB UI action "Generate PDF" on Impact analysis table(sn_bia_analysis), which generates pdf but there is no pdf number on generated pdf, Can anyone please help me , what to do to make page number appear, screenshots attached

sunilmaddheshi_0-1785689678401.pngsunilmaddheshi_1-1785689776629.png

 

15 REPLIES 15

Hi @sunil maddheshi 

 

I thought First article will only help you and you are right, it is using GenerateDocumentAPI.

If that does not help, I thought other API i.e PDFGenerationAPI might help you.

Please Accept the solution if it assisted you with your question & Mark this response as Helpful.
Regards
Tanushree Maiti
ServiceNow Technical Architect
LinkedIn: https://www.linkedin.com/in/tanushreemaiti

abirakundu23
Giga Sage

Hi @sunil maddheshi ,

You have to uses  "GeneratePageNumber : true" which create automatically page number buttom right corner of the page.

Please follow below thread :https://www.servicenow.com/community/developer-articles/generating-custom-pdfs-using-the-new-pdfgene...

Product Documentation: https://www.servicenow.com/docs/r/api-reference/server-api-reference/PDFGenerationAPIBothAPI.html

Please mark helpful & correct answer if it's  worthy for you.

surajsengar
Tera Contributor

@sunil maddheshi  - 

If the BCM "Generate PDF" button is an out-of-the-box UI Action, inspect:

  1. UI Action behind the button.
  2. Associated Script Include.
  3. Whether it uses:
    • sn_pdfgeneratorutils.PDFGenerationAPI
    • PDF Template
    • GeneralPDF
    • Document Services

If it is already calling convertToPDFWithHeaderFooter(), add: 

GeneratePageNumber : "true" 

sunil maddheshi
Tera Guru

Thanks everyone for your response, I got the solution for it. we just need to add the default in page number field on BIA PDF Template. 

VJ_Srivastava
Tera Contributor

Hello @sunil maddheshi,

From an architectural perspective, the most critical rule in this scenario is to preserve the integrity of the out-of-the-box (OOB) UI Action script you highlighted. Modifying core BCM document generation scripts to solve a formatting issue introduces unnecessary technical debt and will almost certainly cause skipped records during your next platform upgrade.

The correct architectural approach is strictly declarative. The pagination must be handled within the HTML Document Template's layout and CSS properties, completely decoupling the visual output from the backend generation logic.

Standardizing these compliance templates across your BCM module is an excellent initiative to hand off to your global and offshore engineering teams. Leveraging this offshore talent to build a highly reusable, properly formatted template architecture—without touching OOB code—is a top-tier strategic advantage. It ensures your platform remains highly scalable, upgrade-safe, and capable of generating perfectly formatted documents across any module.