How to export Excel, PDF, and CSV with images

How to export Excel, PDF, and CSV with images

mercury15mercury15 Posts: 14Questions: 6Answers: 0

How to export excel, pdf, and csv with images from a jquery datatable. 
while export excludes the last column buttons. Here, images are not in base64 directly linked with the server url. Please help
https://jsbin.com/burifuz/edit?html,js,output

Answers

  • allanallan Posts: 63,531Questions: 1Answers: 10,475 Site admin

    They are each different in how they would handle images:

    • CSV - its a text format so naturally the base64 string would just show as a string
    • Excel - our exporter does not support images - it would require customisation of the Excel export code. I would suggest instead of attempting that (although you are welcome to do so and send a PR if you do) you should use something like SheetJS.
    • PDF - We use pdfmake for the PDF export and it does have support for images built in, but our exporter is not fully integrated with that. You would need to use the customize callback of pdfHtml5 to modify the document to include your images.

    In short, this isn't easy and it would require a bit of work to make it all work.

    Allan

Sign In or Register to comment.