Has anyone customized their pdf exports?

joshua18
Giga Expert

Has anyone customized their pdf exports?

Such as like a custom header?

I'm trying to find a good example or something to point me in the right direction. I've been going through UI Actions and the default UI Context menu to go off of but I can't seem to find some of the functions used in it.

1 ACCEPTED SOLUTION

Hi Joshua,



You won't be able to get to see the code behind the GwtPollDialog so you can go the above approach.



You can also check below links


PDF Generator


I am a creator — PDF Document Generator - Walter Brame


http://wiki.servicenow.com/index.php?title=PDF_Web_Service#gsc.tab=0


Custom PDF Files in ServiceNow through PDFCrowd | John Andersen



Also one thing you can do is in the script of UI action for form button add this script


this works for form view



var url = '/u_sample_table.do?PDF&sys_id=' + g_form.getUniqueValue() + '&sysparm_view=default' ;


window.open(url,'_blank');



Mark Correct if this solves your issue and also hit Like and Helpful if you find my response worthy based on the impact.


Thanks


Ankur




Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

View solution in original post

9 REPLIES 9

Hi Joshua,



You won't be able to get to see the code behind the GwtPollDialog so you can go the above approach.



You can also check below links


PDF Generator


I am a creator — PDF Document Generator - Walter Brame


http://wiki.servicenow.com/index.php?title=PDF_Web_Service#gsc.tab=0


Custom PDF Files in ServiceNow through PDFCrowd | John Andersen



Also one thing you can do is in the script of UI action for form button add this script


this works for form view



var url = '/u_sample_table.do?PDF&sys_id=' + g_form.getUniqueValue() + '&sysparm_view=default' ;


window.open(url,'_blank');



Mark Correct if this solves your issue and also hit Like and Helpful if you find my response worthy based on the impact.


Thanks


Ankur




Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

I think those will point me in the right direction.



Thanks!


Hi Joshua,



Thanks for marking the answer as correct and helpful. It would be great if you endorse the content so that it has high visibility. Thanks in advance.



Regards


Ankur


Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

by using UI action script, PDF downloaded, as well can we add LOGO on top of PDF.

 

function createPDFESS() {

 var sysparm_table = g_form.getTableName();

 var sysparm_sys_id = g_form.getUniqueValue().toString();

 var url = sysparm_table + '.do?PDF&sys_id=' + sysparm_sys_id;

 window.open(url);

 }

find_real_file.png

 

find_real_file.png

adrianq9
Tera Contributor

I am wondering if ServiceNow has updated this at all since the question was asked 5 years ago?

I want to change the ugly project form that is exported as a PDF as well.

Can't believe ServiceNow is so ugly and difficult to do things.