jsPDF
jsPDF copied to clipboard
PNG addImage corrupted
Some images are corrupted. I was try wait for image loaded, try use blob, but nothing help Test code on page: http://raw.githack.com/MrRio/jsPDF/master/index.html
Issue:
Require:
call @jamesbrobb and @diegocr for help 😔
Have you tried setting the second argument of addImage
to the correct image type? Does that help?
Have you tried setting the second argument of
addImage
to the correct image type? Does that help?
Nothing. I was try to set "PNG", change compression level, change another arguments but nothing. Some images printing normally, some with this error...
This issue is stale because it has been open 90 days with no activity. It will be closed soon. Please comment/reopen if this issue is still relevant.
actual
bump
This issue is stale because it has been open 90 days with no activity. It will be closed soon. Please comment/reopen if this issue is still relevant.
active
This issue is stale because it has been open 90 days with no activity. It will be closed soon. Please comment/reopen if this issue is still relevant.
active
This issue is stale because it has been open 90 days with no activity. It will be closed soon. Please comment/reopen if this issue is still relevant.
active
I'm having the same issue. Trying to add png image in node.js. I tried already base64, base64 with uri prefix, Uint8Array, different formats of image. Not working.
All I get is this, instead of the checkbox icon:
@dev-ton, we are experiencing this exact issue as well. PNG loaded into Uint8Array.
@dev-ton, I assume you are using this library with Node or Bun?
We have found a fix: you must call doc.output
with argument 'arraybuffer'
: doc.output('arraybuffer')
. PNGs will now render correctly. Without this fix, JPGs will be invisible. With the fix, they show up just fine.
This should definitely be mentioned in the documentation somewhere, this is too obscure to expect users to find.
@toondkn, not working in my case. Maybe working for @dev-ton