RE: How to download PDF from SuiteScript?
Answered
Hi,
I’m looking for a way to download a PDF directly from a client script. I am currently using the N/file module to save any PDF’s that I generate into the file cabinet.
How would I make it so that I can download the PDF rather than save it in the file cabinet?
Best answer
Hi Daniel,
You can use the render module to render and then write the file. You can have it either display or download.
Zack
var renderer=render.create();
renderer.templateContent=xmlStr;
var newfile=renderer.renderAsPdf();
response.writeFile(newfile, true);