UI page to PDF
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-19-2020 03:53 AM
Hi,
Hope you are doing well!!
Can we export the UI page into PDF with a button placed on the Ui page?
I have a requirement to export the page into pdf onclick of a button.
Thanks in advance.
Regards,
Vamshi
- Labels:
-
Multiple Versions
-
User Interface (UI)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-20-2020 09:19 AM
window.print(); is an easy solution here. If you have a more specific use case, I've had good luck using jsPDF: https://github.com/MrRio/jsPDF
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-23-2020 05:12 AM
Have your button call this function:
function exportMyPage2PDF(){
var dialog = new GwtPollDialog('/my_ui_page.do', JSON.stringify(null), 0, '', 'whtpexport');
dialog.on('beforeclose', function() {
window.setTimeout(function(){
$j('.download-report').focus();
}, 100);
});
dialog.execute();
}
Blog: https://sys.properties | Telegram: https://t.me/sys_properties | LinkedIn: https://www.linkedin.com/in/slava-savitsky/
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-23-2020 10:30 PM
Thanks for the Reply!!
This helped me a lot. But I am not getting the images that are in the ui page into pdf and also can we change the name of the PDF that is getting exported?
Regards,
Vamshi
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-23-2020 10:44 PM
Try checking this
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader