Jspdf-autotable: Add image to table

Created on 8 Dec 2015  路  10Comments  路  Source: simonbengtsson/jsPDF-AutoTable

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

Most helpful comment

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;
}
}

All 10 comments

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

thank you.

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

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;
}
}

Glad you solved your problem.

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

@simonbengtsson This functionality is not there yet right ?

Which feature?

@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

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.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

simonbengtsson picture simonbengtsson  路  5Comments

bsparacino picture bsparacino  路  3Comments

webdream-fr picture webdream-fr  路  6Comments

tapz picture tapz  路  3Comments

mmghv picture mmghv  路  4Comments