Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

ndungujay's avatar

Loosing CSS when i try to export

Hello, i am working on an item function which should generate a pdf document which has too many css and its loosing css.Currently i have tested WKHTMLTOPDF and DOMPDF and both loose css.Any idea on how i can get a final pdf document without loosing css. A package or api which i can use for this function

0 likes
1 reply
Reached's avatar
Reached
Best Answer
Level 11

Styling PDF's can be an absolute PAIN. I would advice using something like Spatie Browsershot, it's a bit easier to get the result you want in my opinion :)

Please or to participate in this conversation.