Can I use Js in dompdf I need to use some javascript, jquery to do something inside my pdf blade file. but js is not working in pdf blade i tried the same thing in other view blade and it's working perfectly.
is there any way i can use js in pdf balde file which use to generate pdf view using dompdf
thanks
Do you mean that the js should work inside the pdf so it's interactive? Or just edit the html before the pdf is generated
@zache09 I would think that to be possible yes. Check that your your js runs at all by doing something else, like add a red background
And be sure it's on the page and not in a separate js file
@zache09 show the code please. Did you add all of jquery in a script tag?
If you don't want to inline all of your js, perhaps consider switching to browsershot
@zache09 if you rewrite it to plain js it should work. Dompdf ignores the jquery script tag as it's external
@zache09 no. You would need to manually add all of jquery to a script tag on the page
@zache09 that might take some research. Did you try my suggestion with browsershot? It should just work
Please sign in or create an account to participate in this conversation.