Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Add multiple element in header pdfmake

I am making a sales invoice pdf using pdfmake. I want to put my company logo, and company details such as name, contact number, email, website etc in the header of the pdf document. I tried

header: "document header"

var docDefinition = {
  header: 'simple text',

  footer: {
    columns: [
      'Left part',
      { text: 'Right part', alignment: 'right' }
    ]
  },

  content: (...)
};

I can only add one pdfmake element. I want to add multiple-element in the header (and footer) of the document. Is it possible to add multiple-element? Is there any alternative way to achieve this?

[1] https://pdfmake.github.io/docs/document-definition-object/headers-footers/

I tried example from above url[1]. it doesn't mention multiple elements.

like image 697
Manu Varghese Avatar asked Mar 18 '26 19:03

Manu Varghese


1 Answers

For adding multiple elements in header , you have to adjust page margin. It can be done as follow:

             pageMargins: [ 40, 60, 40, 60 ],

You can change these values according to your requirements.

like image 77
H S Progr Avatar answered Mar 20 '26 09:03

H S Progr



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!