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

NehaG8791370651
Tera Contributor

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:

  1. 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); } }

  2. 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!