Search code examples
javascriptjqueryjquery-uidatatablespdfmake

Image pdfmake customization


I'm using pdfmake and I have a image in base64 like this in the documentation.

How can I put the image before the title?

check photo

extend: 'pdfHtml5',
orientation: 'landscape',
pageSize: 'A3',
sTitle: "id",
mDataProp: "id",
sWidth: '250%',[enter image description here][1]
customize: function(doc) {
doc.content.splice(1, 0, {
                  columns: [{
                        margin: 10,
                        alignment: 'left',
                        image: 'data:image/png;base64,/...',
                                    width: 95,
                                    height: 40,
                                },]
                            });
                        },

Solution

  • Change

    doc.content.splice(1, 0, {

    to be:

    doc.content.splice(0, 0, {