PDF Generation

manju12
Tera Expert

Hi Team,

 

How to generate the PDF form in FSO related concept.  Please help me out 

 

Thanks,

Manju

4 REPLIES 4

Dr Atul G- LNG
Tera Patron

Hi @manju12 

 

https://www.servicenow.com/docs/r/yokohama/api-reference/server-api-reference/PDFGenerationAPIBothAP...

 

*************************************************************************************************************
Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/dratulgrover [ Connect for 1-1 Session]

****************************************************************************************************************

Ankur Bawiskar
Tera Patron

@manju12 

If you are telling you have a Case in FSO and want to generate PDF and attach to record then check this

you can check the PDF Generation API for this

Generating Custom PDFs - using the new PDFGenerationAPI

another method

Generate PDF and attach to the record

💡 If my response helped, please mark it as correct and close the thread 🔒— this helps future readers find the solution faster! 🙏

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

Tanushree Maiti
Kilo Sage

Hi Manju

Please refer this links, see if it helps you:

https://www.servicenow.com/community/developer-forum/call-sn-pdfgeneratorutils-pdfgenerationapi-in-u...

https://www.youtube.com/watch?v=3uBVeDamzuA

Please mark this response as Helpful & accept it as solution if it assisted you with your question.
Regards
Tanushree Maiti
ServiceNow Technical Architect
Linkedin:
ServiceNow PDF Generation API Magic PDFGenerationAPI API Provides support for PDF conversion and handling PDF fields. This API is part of the ServiceNow PDF Generation utility plugin (com.snc.apppdfgenerator) and is provided within the sn_pdfgeneratorutils namespace. The plugin is activated by ...

adityahubli
Tera Guru

Hello @manju12 ,

 

Earlier i also tried ,custom pdf (UI Action) scenario  on incident table,  its code is as follow:

 

var v = new sn_pdfgeneratorutils.PDFGenerationAPI;

 (Option) get HTML from the description field of an incident record
var gr = new GlideRecord("incident");
var html;

if (gr.get(current.sys_id
)) {
    html = "Description:" + gr.description.toString();
    html += "\nShort Description:" + gr.short_description.toString();
    html += "\nNumber:" + gr.number.toString();
    html += "\nPriority:" + gr.getDisplayValue('priority');
    html += "\n Assignment Group:" + gr.getDisplayValue('assignment_group');
    html += "\n Assige to:" + gr.getDisplayValue('assigned_to');
}

var result = v.convertToPDF(html, "incident", current.sys_id, "myPDF");
gs.info(JSON.stringify(result));
if (result) {
    action.setRedirectURL(current);
}
 
 
 
 
If this helps you then mark it as helpful and accept as solution.
Regards,
Aditya