How to generate page number in the pdf through "Generate PDF" button on Impact analysis table(BCM)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
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.
Regards
Tanushree Maiti
ServiceNow Technical Architect
LinkedIn: https://www.linkedin.com/in/tanushreemaiti
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
If the BCM "Generate PDF" button is an out-of-the-box UI Action, inspect:
- UI Action behind the button.
- Associated Script Include.
- Whether it uses:
- sn_pdfgeneratorutils.PDFGenerationAPI
- PDF Template
- GeneralPDF
- Document Services
If it is already calling convertToPDFWithHeaderFooter(), add:
refer : Generating Custom PDFs - using the new PDFGenerati... - ServiceNow Community
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
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.