C
C
cb77772021-05-07 14:00:35
JavaScript
cb7777, 2021-05-07 14:00:35

How to add multiple images to pdf using Pdfmake?

I can't figure out how to add multiple images to a pdf file, with a static description everything works, but I need to pass a list of images in base64.

//печатает таблицу
  printTable(data) {
    //if(this.image_list.lenthis>0){
      console.log(data);
      //структура пдф
      let docDefinition = {
        pageSize:'A4',
        pageOrientation: 'landscape',
        pageMargins:[5,5,5,5],
        defaultStyle:{
          fontSize:8
        },
        content: [
          {
            image:data[0]
          },
          {
            image:data[1]
          },
          {
            image:data[2]
          }
        ],
      };
      pdfMake.createPdf(docDefinition).open();
    //}
  }

A similar way does not become obsolete for me, can this part be dynamically done?
content: [
          {
            image:data					
                                        }
        ],

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question