If I wanted to have a custom button print an advan...
# suitescript
p
If I wanted to have a custom button print an advanced pdf what module and method should I look into?
c
UE before load for the button, then use a client script that calls a suitelet with the N/render module. set your template, add data using render.addCustomDataSource(), then render.renderAsPdf() to generate the pdf. To show the pdf in the suitelet, set response to : response.writeFile({ file : render.renderAsPdf(), isInline : true }); isInline will determine whether the file will be downloaded or displayed. If you want to send your file to a printer to have it automatically printed, then I would recommend using PrintNode - a restlet for calling that API should exist in the WMS bundle.
👍 1
p
perfect. thanks!