Oct 7, 2023
0
Level 1
Enable JavaScript in DomPDF?
Can I somehow use javascript inside DomPDF? I use this package https://github.com/barryvdh/laravel-dompdf and I found javascript option in the dompdf config file:
/**
* Enable inline Javascript
*
* If this setting is set to true then DOMPDF will automatically insert
* JavaScript code contained within <script type="text/javascript"> ... </script> tags.
*
* @var bool
*/
'enable_javascript' => true,
I added my js:
<script type="text/javascript">
//change header text to "hello world"
document.getElementById('header_text').innerHTML = 'Hello World';
</script>
And it still doesn't do anything. Any ideas?
Please or to participate in this conversation.