Forum How do I...?

PNG with alpha in the @page { background: url(bg.png) }

VasiliPascal
Hello,

Im trying to use a PNG file with transparency in the background, but I don't see image in the background in the result PDF file.

Example of a simple html can be found here : http://dev.webdirect.us/prince/test.html
and the result PDF is here: http://dev.webdirect.us/prince/out.pdf.

Does Prince support PNG with alpha in background ?

Thanks.
mikeday
Yes, it's working perfectly, the image is just too big! Since the image is 2480x3508 pixels in size, the resolution needs to be more than 300dpi just to fit on the page.

Alternatively, in Prince 9 you can use "background-size: 100%" to scale it to fit the container without knowing the exact resolution, which might be more convenient.
VasiliPascal
background-size: 100%" worked fine !
Thanks for fast response !