Merge external PDF into recipe
-
Hello, I was wondering if its possible in the jsreports system to pass through an external pdf in base64 or any other format and merge it into a recipe I have created for making a report?
Regards
Michael
-
Yes, you can use a custom jsreport script where you can code what you need
https://jsreport.net/learn/scripts
https://jsreport.net/learn/pdf-utils#usage-in-scriptconst jsreport = require('jsreport-proxy') async function afterRender (req, res) { res.content = await jsreport.pdfUtils.merge(res.content, Buffer.from(req.data.externalPdf, 'base64')) }Full demo here
https://playground.jsreport.net/w/anon/2lCyXIBl