Create a PDF file without attach it to any table
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-11-2022 08:14 AM
I write following code which create a pdf file and attach it ti incident table :
var document = null;
var pdfDoc = new GeneralPDF.Document(null, null, null, null, null, null);
document = new GeneralPDF(pdfDoc, null, null);
document.startHTMLParser();
document.addHTML(this.getParameter('sysparm_html'));
document.stopHTMLParser();
var att = new GeneralPDF.Attachment();
att.setTableName("incident");
att.setTableId("e8caedcbc0a80164017df472f39eaed1");
att.setName("filename");
att.setType('application/pdf');
att.setBody(document.get());
GeneralPDF.attach(att);
I want to know if it possible to create a pdf file in ServiceNow without attach il to any table ? I yes, how can I improve my code ?
Thanks in advance,
Carole
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-09-2022 09:38 AM
Thanks for sharing it here. As I was creating pdf for nagaland state results manually but that was not getting attached. Going to try this method I hope it will work for us and we will easily provide the pdf file without attachement.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-10-2022 10:55 AM
Any luck with this? I'm trying to do the same thing. Have the need to generate a document and download immediately, but without having to store the attachment in the system. Thanks!