Closed Shotman closed 6 months ago
Closing since adding the base
tag once again, after trying many other things it works, sooo no idea what happened if I figure it out I'll add a comment to explain what it was
Edit :
I figured out the exact issue, when using the assetMapper in dev mode it doesn't work because of internal Symfony routing.
So the solution is for PDF rendering testing you have to compile the assets in production mode temporarly with asset-map:compile
and then it works perfectly ! And after than to go back to normal dev mode, just delete the asset folder in the public folder.
Hope it will help people who have the same problem
Hello I'm making a PDF generation service for Symfony but the problem at the moment is that CSS is not loaded.
I'm using asset mapper, and it's using and import map that looks like this :
And when I generate the PDF like that :
The css is not loaded in the pdf whereas if I just return the HTML on it's own my browser loads the css without issues.
I've looked with Symfony/Twig/AssetMapper ways to change urls to absolute ones with no success
I've also tried adding a
<base href="absolute_website_origin" />
to my HTML but doing that makes the PDF generation not working it just hangs foreverSo is there anything I could do to make it work ?
Thanks