How to resolve a PDF truncate situation because of some lengthy description in the PDF

ABHI08
Tera Contributor

When generating a PDF using the Generate PDF UI Action, the preview correctly displays all the expected information. However, the final PDF omits some details. The issue appears to stem from one of the Description field entries, which is quite long and causes the subsequent information to be truncated.

I would like to understand how to troubleshoot this issue without reducing the font size. Although decreasing the font size resolved the problem, I want to explore alternative troubleshooting methods and know the maximum content length a generated PDF can support.

7 REPLIES 7

Jennifer Metz
Tera Guru

Hello @ABHI08,

 

What method is your UI action using to generate the pdf?

 

Jennifer Metz
Sr. ServiceNow Developer | Infosys

kaushal_snow
Giga Sage

@ABHI08 ,

 

when you use the Generate pdf ui action or the pdfgenerationapi to turn a form or HTML into a PDF, it will truncate parts of the output if the content exceeds the fixed physical page size or layout constraints being used for the pdf conversion rather than any hard maximum text length...... so long descriptions or large blocks of text can make the rest of the PDF cut off even though the preview looks fine, and the usual way to troubleshoot this without shrinking font size is to review how your html/layout is structured so it can break across pages and, if you’re calling the api directly, use options like convertToPDFWithHeaderFooter() and adjust page size, margins or add explicit page breaks in your template so the content flows to subsequent pages.........

 

for more: https://www.servicenow.com/docs/bundle/xanadu-api-reference/page/app-store/dev_portal/API_reference/...

 

If you found my response helpful, please mark it as ‘Accept as Solution’ and ‘Helpful’. This helps other community members find the right answer more easily and supports the community.

 

Thanks and Regards,
Kaushal Kumar Jha - ServiceNow Technical Consultant - ServiceNow Class of Legends 2025

Matthew_13
Kilo Sage

 The generate PDF preview and the final PDF are rendered by different engines, and the PDF engine enforces stricter layout and page-break rules. When a Description field contains a large amount of text, it can overflow its container and cause subsequent content to be silently truncated, particularly if it is placed inside tables or fixed-height elements.

To troubleshoot this without reducing font size, restructure the template by avoiding tables for long text, removing the fixed height constraints, adding explicit pagebreak controls , and sanitizing any rich-text formatting. ServiceNow does not publish a hard character limit that i know personally , but long rich-text fields typically reach rendering limits sooner than plain text due to these constraints.

Let me know if this helps

@Matthew_13  Thanks for the response. It helped in troubleshooting the issue, as we were using the description field within a table and because the test is long, it silently truncated.