Create and open a pdf file with script

demgnekamdem
Tera Contributor

Hi all,

I want to create an open a pdf file after click on a button (UI action).
Which script can I write on ui page to create an open a pdf file with a table (number, username, email and company) ?

Thanks in advance,
Carole

1 ACCEPTED SOLUTION

AnubhavRitolia
Mega Sage
Mega Sage

Hi,

 

To create PDF document, you can create record in PDF Document Template and than using below code you can generate PDF using UI Action. Check below links:

https://developer.servicenow.com/print_page.do?release=quebec&category=null&identifier=PDFGeneration....

https://docs.servicenow.com/bundle/tokyo-employee-service-management/page/product/human-resources/ta...

 

Please mark this as correct answer and helpful if it resolved, or mark this helpful if this help you to reach towards solution.

Thanks
Anubhav Ritolia
ServiceNow Rising Star 2023

View solution in original post

2 REPLIES 2

Saurav11
Kilo Patron
Kilo Patron

Hello,

 

Did you go through the below article:-

 

https://www.servicenow.com/community/developer-articles/generate-pdf-and-attach-to-the-record/ta-p/2...

 

Please mark answer correct/helpful based on Impact.

AnubhavRitolia
Mega Sage
Mega Sage

Hi,

 

To create PDF document, you can create record in PDF Document Template and than using below code you can generate PDF using UI Action. Check below links:

https://developer.servicenow.com/print_page.do?release=quebec&category=null&identifier=PDFGeneration....

https://docs.servicenow.com/bundle/tokyo-employee-service-management/page/product/human-resources/ta...

 

Please mark this as correct answer and helpful if it resolved, or mark this helpful if this help you to reach towards solution.

Thanks
Anubhav Ritolia
ServiceNow Rising Star 2023