jsPDF-AutoTable icon indicating copy to clipboard operation
jsPDF-AutoTable copied to clipboard

Add image to table

Open wilywork opened this issue 10 years ago • 10 comments

hello, is possible add image in table row ? rowsTable = ["data:image/jpeg;base64,/9j/4A ........", "text","text"

wilywork avatar Dec 08 '15 11:12 wilywork

No, not at the moment. I got a request for this the other day as well however and will probably add it in a future release at some point, but don't hold your breath... You can do it with hooks today anyway, here is an example http://codepen.io/someatoms/pen/vLYXWB

simonbengtsson avatar Dec 08 '15 11:12 simonbengtsson

thank you.

wilywork avatar Dec 08 '15 11:12 wilywork

this method is bug in multiple page , http://codepen.io/anon/pen/ZQYxJY?editors=101

wilywork avatar Dec 08 '15 13:12 wilywork

solvid,
for (var i = 0; i < images.length; i++) { if(!images[i].usado){ doc.addImage(images[i].elem, 'jpg', images[i].x, images[i].y); images[i].usado = true; } }

wilywork avatar Dec 08 '15 19:12 wilywork

Glad you solved your problem.

simonbengtsson avatar Feb 10 '16 18:02 simonbengtsson

What should i do if i want to add .png image in autotable? i tried with angular-base64-min.js but it accepts only jpeg format. i'm unable to add png formatted image in header, doc.addImage(headerImgData., 'png', 40, doc.autoTableEndPosY() + 10, height, width); can you suggest me for this

poohsasne avatar Dec 16 '16 09:12 poohsasne

@simonbengtsson This functionality is not there yet right ?

viraj4422 avatar Jan 07 '19 21:01 viraj4422

Which feature?

simonbengtsson avatar Jan 07 '19 21:01 simonbengtsson

@simonbengtsson Adding an image in table row. Codepen link that you mentioned in previous comments, does not seem to display images http://codepen.io/someatoms/pen/vLYXWB

viraj4422 avatar Jan 07 '19 21:01 viraj4422

I pointed that codepen to v2.3.5 so it should work now. Adding images to cells should be a lot easier now with v3 though with the hook didDrawCell instead of drawCell.

simonbengtsson avatar Jan 08 '19 13:01 simonbengtsson