Thank you very much, this is exactly what I was looking for.
R
reidsentry
@reidsentry
0
Reputation
2
Posts
356
Profile views
0
Followers
0
Following
Posts made by reidsentry
-
RE: Modify an existing webpage before rendering with chrome-pdf
-
Modify an existing webpage before rendering with chrome-pdf
Is it possible to alter an existing webpage before rendering with chrome-pdf recipe? For example, if you wanted to hide the navbar of the jsreport homepage using the below script:
playground: https://playground.jsreport.net/w/reidsentry/XY6lykpe
function beforeRender(req, res) {
req.template.chrome = {
"url": "https://jsreport.net"
};
req.template.content +=<script> document.querySelector('.navigation-bar').style.display = 'none'; </script>
;
}I imagine this doesn't work because the content isn't used the same when a url is set, but I don't know.