Hello.
Case wrong font:
I copy folder with files like below into linux and install font. In jsreport.config.json i set:
"pdf": {
"fontDirectory": "/root_etc/fonts/"
},
Most of the times it works fine. But sometimes the system load is exceptionally high. The font will be wrong.
Case rerender i use it but not work:
const jsreport = require('jsreport')()
async function afterRender (req, res) {
console.log("----------------------------- HELP...")
// do some checks if res.content is ok
if (req.data.counter > 10) {
console.log("----------------------------- XXXX...")
return
}
const r = await jsreport.render({
template: { ...req.template },
data: { ...req.data, counter: (req.data.counter || 0) + 1 }
})
res.content = r.content
}
if (process.env.JSREPORT_CLI) {
// export jsreport instance to make it possible to use jsreport-cli
module.exports = jsreport
} else {
console.log("INIT!")
jsreport.init().then(() => {
// running
}).catch((e) => {
// error during startup
console.error(e.stack)
process.exit(1)
})
}