converting email to PDF
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
yesterday
I have written below script to convert email to PDF and attaching to the respective target it was working fine
But my email body content not fitting to the page in the PDF, please help me on this one.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
7 hours ago
Hi @Swathi KS
May this help you
https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB1638958
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
7 hours ago
possibly because of styling.
try this
var html = '<html><head><style>' +
'@page { margin: 1in; }' +
'body { font-family: Arial, sans-serif; font-size: 12pt; margin: 0; padding: 0; }' +
'.content { max-width: 7in; }' +
'</style></head><body>' +
'<div class="content">' +
'<h2>' + current.subject + '</h2>' +
'<div>' + current.body + '</div>' +
'</div></body></html>';
var result = new sn_pdfgeneratorutils.PDFGenerationAPI().convertToPDF(html, current.target_table, current.instance, 'Original Compliance Notification');
action.setRedirect(current);
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
7 hours ago
See if below helps,
https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0689606
If this helped to answer your query, please mark it helpful & accept the solution.
Thanks,
Bhuvan