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
Hi Sunil,
This is a very common requirement when generating Business Impact Analysis (BIA) reports! Looking at your screenshots, the UI Action is calling the standard GenerateBIAPdfUtil, which under the hood relies on ServiceNow's Document Templates API.
The key here is that you do not need to customize the UI Action or the Script Include. The pagination logic lives entirely in the presentation layer—specifically within the HTML Document Template (BIA PDF Template).
To get the page numbers to appear:
CSS Paged Media: ServiceNow's PDF generator respects standard CSS paged media rules. In the HTML source of your Document Template, you can inject a <style> block that defines the page counter. For example: @page { @bottom-right { content: "Page " counter(page) " of " counter(pages); } }
Headers and Footers: Alternatively, check the related lists at the bottom of your BIA PDF Template record. If you are using the advanced Document Templates, there are often specific Header and Footer records you can link to the template where you can insert standard page numbering variables.
Keep the backend script OOB and focus on the CSS/Template configuration!