Document templates to generate PDF with images in HTML fields
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
yesterday
Hello,
We have created document templates and calling this API available OOTB to generate PDF out of the ticket.
GenerateDocumentAPI().generateDocumentForTask
We have a few HTML fields in the ticket where in the users insert tables/images, copy/paste screenshots into it.
PDF exports the content in HTML field as well, but the images are not exported into PDF correctly (truncates, right side cutoff, chopped bottom, cut when split across pages etc.,). We tried adjusting the HTML format in the template scrips by forcing a fixed height or width, resizing but it does not work consistently. We also tried to keep the image size to fit the A4 page width, but it does not work.
Has anyone faced similar limitations and have some ideas to solve them?
Taking a step back, we also analysed why this requirement to be supplied in ServiceNow and explored alternatives for rendering reports without losing the content in the rich text fields. There are no better alternatives and tried document templates as there is a limitation in the ''Export to PDF' option provided in contextual menu in the record OOTB.
Regards,
Viji
2 REPLIES 2
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
yesterday
you can check docs about this limitation if any.
Regards,
Ankur
✨ Certified Technical Architect || ✨ 10x ServiceNow MVP || ✨ ServiceNow Community Leader
Ankur
✨ Certified Technical Architect || ✨ 10x ServiceNow MVP || ✨ ServiceNow Community Leader
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 hours ago
Thanks for your response, Ankur. I could not find any in the doco.