Can I export image to excel, pdf and print
Can I export image to excel, pdf and print
https://codepen.io/dpkkm/pen/NWpVBgx
Durga Prasad | 31/M | |
Ramavtar | 40/M | |
Suresh Chand | 35/M |
https://codepen.io/dpkkm/pen/NWpVBgx
Durga Prasad | 31/M | |
Ramavtar | 40/M | |
Suresh Chand | 35/M |
Answers
Please refer to the answer you were given the last time you asked this question:
https://datatables.net/forums/discussion/65174
Sir, I am a new developer, so i try to learn, I have tried many times. but something wrong. I don't understand and it is not working. please create new code for me.
Try this SO thread, there seems to be a working example there,
Colin
Not Working, please check it
$dp="https://image.shutterstock.com/image-vector/man-shirt-tie-businessman-avatar-260nw-548848999.jpg";
$type = pathinfo($dp, PATHINFO_EXTENSION);
$data = file_get_contents($dp);
$imgdata = base64_encode($data);
$src = 'data:image/'.$type.';base64,'.$imgdata;
<td class="selected">
$(document).ready(function() { $('#example').DataTable( { dom: 'Bfrtip', buttons: [ { extend: 'pdfHtml5', orientation: 'landscape', customize: function(doc){ if(doc){ for (var i = 1; i < doc.content[1].table.body.length; i++) { doc.content[1].table.body[i][1] = { image: '<?php echo $src; ?>, }; } } }, exportOptions:{ stripHtml: false } }, ], }); } );<?php echo '<img class="img-fluid" src="'.$src.'" style="width:80px;">'; ?>
</td>
We're happy to take a look, but as per the forum rules, please link to a test case - a test case that replicates the issue will ensure you'll get a quick and accurate response. Information on how to create a test case (if you aren't able to link to the page you are working on) is available here.
Cheers,
Colin