let transactionFile = render.transaction({
entityId: parseInt(internal id of the transaction)
printMode: render.PrintMode.PDF,
});
log.debug(“pdf”, transactionFile)
transactionFile.folder = internal id of the folder where you want to save the pdf file;
let fileId = transactionFile.save();
log.debug(“fiel id”, fileId)
let pdfFile = file.load({
id: parseInt(fileId)
});
let fileContents = pdfFile.getContents();
log.debug(“file contents”, fileContents)
the getContents() returns the pdf as base64 format, which is useful to integration purpose.