KnpLabs / snappy

PHP library allowing thumbnail, snapshot or PDF generation from a url or a html page. Wrapper for wkhtmltopdf/wkhtmltoimage
https://knplabs.com
MIT License
4.39k stars 435 forks source link

background image does not show #394

Closed johannesvlot closed 4 years ago

johannesvlot commented 4 years ago

I am generating a pdf and i'd like to have a background image on the whole pdf.

Outputting the pdf works fine only the background doesn't show.

I tried:

<body style="background-image: {{ absolute_url(asset('img/signatures/'~ workOrder.id ~'.png')) }}">

In style tags: <style> body { background-image: {{ absolute_url(asset('img/signatures/'~ workOrder.id ~'.png')) }} } </style>

(tried without absolute url's too)

I don't see anything of the background image.

please help thanks

stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

alexpozzi commented 4 years ago

Hello, Which version of wkhtmltopdf are you using? Are you sure your php process can access the url you are providing as background image?