Export all images in row

Export all images in row

yurirnyurirn Posts: 1Questions: 0Answers: 0
edited March 2023 in Free community support

when I try to export the images that are in the lines, only the first 288 items come, the rest comes without an image, has anyone gone through this? Is there any way I can export all the images?

obs: the images are already loaded in base64

! {
! extend: 'pdfHtml5',
! customize: function(doc) {
!
! if (dataTable.rows({selected: true}).count() == 0) {
! var arr2 = $('.img-fluid').map(function(){
! return this.src;
! }).get();
!
! for (var i = 0, c = 1; i < arr2.length; i++, c++) {
! doc.content[1].table.body[c][1] = {
! image: arr2[i],
! width: 40
! }
! }
!
!
! }
! else {
! var arr2 = $('tr.selected .img-fluid').map(function(){
! return this.src;
! }).get();
!
! }
! for (var i = 0, c = 1; i < arr2.length; i++, c++) {
! doc.content[1].table.body[c][1] = {
! image: arr2[i],
! width: 40
! }
! }
! },
! exportOptions: {
! columns: ':visible',
! stripHtml: true,
! }

Replies

  • allanallan Posts: 61,446Questions: 1Answers: 10,054 Site admin

    The exporter we provide doesn't take account of images, which is why you'll be seeing an empty string at the moment. However, the pdfmake library that we use for the PDF generation does support images so you could use the customize callback of the pdfHtml5 button type to modify the document structure that we create and add in your images.

    It looks like from the code above you might be trying that already. Without a full working test case showing the issue, I can't say why it might not be working.

    Allan

Sign In or Register to comment.