thujohn / pdf-l4

Dompdf for Laravel 4
MIT License
228 stars 72 forks source link

Strange behavior with CSS and Homestead #63

Open psychonetic opened 10 years ago

psychonetic commented 10 years ago

I try to generate pdf files in homestead, but when I try to use a CSS File inside the HTML it doesn't work. The pdf class just renders the pdf without any css.

The strange thing is: on Windows it's working perfectly (using XAMPP), also on my MacBook with MAMP. But when I try to use homestead on my MacBook, the css rules are never applied, just the plain text is rendering.

Also strange is, if I output the html before rendering to pdf, the html is correct with all css rules etc. But the pdf is again just plain text.

The CSS also works if I putting it directly within the html file via. style attribute into the head.

So does anybody have the same problem or any suggestions?

warksit commented 10 years ago

The link to the css expects to be viewed from 'outside' the vm (ie port 8000) so when the pdf is rendered from within the vm it fails to load the css. I have the same issue with images. Not worked round it as yet.