title: Datatable pdfHtml5 change header & footer value position in PDF
body: <p>Im exporting PDF from the datatable using <code>PDFHTML5</code>, passing few data to the header and footer of the PDF.</p>
  <p>Below are the few data position I want to display in the header and footer of the PDF.</p>
  <pre><code>var logo_position = obj[0].value; //top center
  var date_position = obj[1].value; //bottom left
  var rec_no_position = obj[2].value; // bottom middle
  var page_status = obj[3].value; //bottom right
  </code></pre>
  <p>The above object values are getting from the database so it is based on the user selection.</p>
  <p>I'm looking for the header &amp; footer values in the PDF to display in the position mentioned in the variable.</p>
  <p><strong>For example:</strong>
  Currently, the logo is displaying in the PDF in the top left corner. I want to display it in the center of the PDF as the <code>logo_position</code> value is top center. Same for footer also.</p>
  <pre><code>$.extend(true, $.fn.dataTable.defaults, {
      buttons: [
          {
              text:'Save as PDF',
              className: &quot;btn btn-primary&quot;,
              extend: 'pdfHtml5',
              download: 'open',
              title: 'List of Records',
              exportOptions: {
                  columns: ':not(:last-child)'
              },
              customize: function ( doc ) {
                  var now = new Date();
                  var jsDate = now.getDate()+'-'+(now.getMonth()+1)+'-'+now.getFullYear();
                  doc['header']=(function() {
                      return {
                          columns: [
                              {
                                  image: logo,
                                  width: 24
                              }
                          ],
                          margin: 20
                      }
                  });
                  doc['footer']=(function(page, pages) {
                      return {
                          columns: [
                              {
                                  text: ['Printed on: ', { text: jsDate.toString() }]
                              },
                              {
                                  text: [{ text: $(&quot;#page_no&quot;).text() }]
                              },
                              {
                                  text: ['page ', { text: page.toString() },  ' of ', { text: pages.toString() }]
                              }
                          ],
                          margin: 20
                      }
                  });
              }
          }
      ]
  });
  </code></pre>