jussiniinikoski / wasm-pdf

Generate PDF files with JavaScript and WASM (WebAssembly)
Apache License 2.0
480 stars 52 forks source link

Transparent PNGs Rendering With Black Background #9

Open Jamie0 opened 4 years ago

Jamie0 commented 4 years ago

At the moment, when including a transparent PNG in a generated PDF, with fit_width set to true, the image instead has a black background.

I haven't tested other image formats with alpha channels yet, but this could apply to other formats.

jussiniinikoski commented 4 years ago

Thanks for testing! All images are currently translated to JPG format via canvas element, so transparent backgrounds are unfortunately not an option. We could handle PNG images separately, so I'm sticking an enhancement label to this issue.