Covert UI page to pdf and attach to form
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-29-2023 10:27 PM
Hi all , I created a ui page, This Ui page open when I click Ui button in form. Now after filling Ui page if i click submit button in UI page it should be converted to pdf and attach to that form.. How can i achieve this . can anyone help
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-30-2023 12:22 AM
Hello @SAM321
Use this script :-
var gr=new GlideRecord('your table name');
if(gr.get('current.sys_id'))
{
var pdfconverter = new global.GlideHTMLToPConverter();
var pdfDocument = pdfConverter.convert();
var attachment = new global.GlideSysAttachment();
attachment.write(gr, 'your table name', 'PDF Attachment', 'application/pdf', pdfDocument);
}
else{
gs.error('record not found');
}
Plz mark my solution as Accept, If you find it helpful.
Regards,
Samaksh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-30-2023 12:33 AM
you will have to try using PDF Generation API, somehow get the complete HTML of your UI page and then convert it to PDF
Generating Custom PDFs - using the new PDFGenerationAPI
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
‎08-21-2024 05:07 AM
Is there a away to convert email to attachment.
Email received in sys_email table should be converted to attachment
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-12-2024 05:16 AM
Interesting topic for discussion. Is it possible to integrate an API from an online converter like https://pdfguru.com/csv-to-pdf that can convert data from HTML or CSV to PDF? Of course, an API key is required, but still. I’m specifically interested in this solution because I often work with online converters and PDF editors.