Generating dynamic data into PDF Template
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
a month ago - last edited a month ago
Hello @there,
I have a requirement as below. How can we,
- have a PDF template?
- generate / update the content in that PDF?
I am seeking some suggestions on how it can be done. Your inputs are appreciated. Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
a month ago - last edited a month ago
Hi @rimarishi0803 ,
You can achieve PDF generation and updates in ServiceNow through multiple approaches, depending on how dynamic or automated you want the process to be:
1. Using Document Templates (Recommended OOB option)
Navigate to Document Templates to create a template.
Design a Word or PDF layout and use field placeholders to dynamically populate record data.
This is the most straightforward option for business documents like letters, reports, or acknowledgments.
2. Using the sn_pdfgeneratorutils API (Dynamic PDF Generation)
For more control or custom layouts, use the PDF Generation API (sn_pdfgeneratorutils.PDFGenerationAPI) to convert HTML content into PDF and attach it to a record.
This approach is ideal when you need to dynamically generate or update PDF content based on record data or system logic.
The API also supports headers, footers, page numbering, custom fonts, and images for rich formatting and branding.
3. Using UI Actions or Scripted REST APIs
Add a UI Action (e.g., “Generate PDF”) on record forms to allow users to trigger PDF creation manually.
Alternatively, use a Scripted REST API to generate and return the PDF programmatically, for external or automated integrations.
For more details and best practices, refer to the following helpful resources:
If my response helped, please mark it as the accepted solution so others can benefit as well.
