PDF Export images

PDF Export images

viandanteviandante Posts: 22Questions: 10Answers: 1

Hi to all,

I must export the table data into pdf, and in the td cells there are some images... can i export in the pdf?
Actually the exported pdf has a blank cell instead of the image.

Thanks

Massimo

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 63,281Questions: 1Answers: 10,425 Site admin
    Answer ✓

    Currently no - the image export in the PDF library is limited to base64 images only so you'd need to load each image as based 64. You could do that and modify the PDF document (see the pdfmake documentation) but you'd probably find it easier simply creating the PDF on the server-side and downloading it to the client using a PDF libraries for your server.

    Allan

  • viandanteviandante Posts: 22Questions: 10Answers: 1

    Ok thanks.

    I supposed this...

    Massimo

  • sancho0410sancho0410 Posts: 2Questions: 1Answers: 0

    Hi,
    Same question i have a cell with <img src="data:image/jpeg;base64, encode64"/> and blank for the excel, pdf and print export ...

    Any ideas ?

    Thanks

  • allanallan Posts: 63,281Questions: 1Answers: 10,425 Site admin

    As I stated above, there is currently no option for this in the API that Buttons presents. You could potentially use the pdfmake API - which you can access through the customize method of the pdfHtml5 button type, but it is not something that is a part of the DataTables software.

    Allan

This discussion has been closed.