hello here is the play ground link https://playground.jsreport.net/w/anon/A1IwPbzb
G
Gayen-M
@Gayen-M
0
Reputation
5
Posts
497
Profile views
0
Followers
0
Following
Posts made by Gayen-M
-
RE: How to make a header responsive?
-
RE: How to make a header responsive?
yes actually I have made the template responsive and i am changing its orientation from postman i.e. when i set the landscape =true the header is coming correctly but in case of landscape=false there is the problem
-
How to make a header responsive?
how to make a header responsive as when i hit it through Post-man by passing landscape as true or false such that the pdf header become portrait and landscape accordingly as i was trying it by add the below lines in the script but its not working
const jsreport = require('jsreport-proxy') async function afterRender(req, res, done) { const watermarkRes = await jsreport.render({ template: { name: 'header-template', chrome: { landscape: false } } }) const $pdf = await jsreport.pdfUtils.parse(res.content) const pagesToMerge = new Array($pdf.pages.length).fill(watermarkRes.content) const originalBuffer = Buffer.from(res.content) const withWatermarkBuffer = await jsreport.pdfUtils.merge(originalBuffer, pagesToMerge) res.content = await jsreport.pdfUtils.merge(res.content, watermarkRes.content, mergeToFront = false) done(); }