title: Spacing in all pages JSPDF
body: <p>I added a Header &amp; Footer in JSPDF  using help from the following link.
  <a href="https://stackoverflow.com/questions/67225420/adding-header-footer-for-all-screens-in-jspdf">Adding Header &amp; Footer for all screens in JSPDF</a></p>
  <p>The Issue that I get is the spacing between the header and table is getting reflected only in the first page of the downloaded PDF.</p>
  <p>You can check the example reproduced here <a href="https://codesandbox.io/s/upbeat-cannon-cfiry?file=/src/App.js" rel="nofollow noreferrer">https://codesandbox.io/s/upbeat-cannon-cfiry?file=/src/App.js</a>.</p>
  <p>I need to help in getting the same space for all pages between table and Header. Thanks</p>
  <p>Code :</p>
  <pre><code>import jsPDF from &quot;jspdf&quot;;
  import &quot;jspdf-autotable&quot;;
  import { datas } from &quot;./data&quot;;
  import { renderToString } from &quot;react-dom/server&quot;;
  import PdfDocument from &quot;./PdfDocument&quot;;
  export default function App() {
    const columns = [
      { title: &quot;Rank&quot;, dataKey: &quot;Rank&quot; },
      { title: &quot;Name&quot;, dataKey: &quot;Name&quot; },
      { title: &quot;count&quot;, dataKey: &quot;count&quot; }
    ];
  
    var rows = datas?.map((data) =&gt; ({
      Rank: data?.Rank,
      Name: data?.Name,
      count: data?.count
    }));
  
    const downloadPdf = () =&gt; {
      var doc = new jsPDF(&quot;p&quot;, &quot;pt&quot;);
      doc.setFontSize(20);
      doc.setTextColor(40);
      doc.setFontStyle(&quot;normal&quot;);
      doc.autoTable(columns, rows, {
        startY: 70,
  
        margin: { horizontal: 10 },
        styles: { overflow: &quot;linebreak&quot; },
        bodyStyles: { valign: &quot;top&quot; },
        columnStyles: { email: { columnWidth: &quot;wrap&quot; } },
        theme: &quot;striped&quot;,
        showHead: &quot;everyPage&quot;,
        didDrawPage: function (data) {
          // Header
          doc.setFontSize(16);
          doc.setTextColor(&quot;#161C22&quot;);
          doc.text(&quot;Table&quot;, data.settings.margin.left, 35);
          doc.text(&quot;Brand&quot;, 465, 34);
  
          // Footer
          let str = &quot;&quot; + doc.internal.getNumberOfPages();
          doc.setFontSize(10);
  
          // jsPDF 1.4+ uses getWidth, &lt;1.4 uses .width
          let pageSize = doc.internal.pageSize;
          let pageHeight = pageSize.height
            ? pageSize.height
            : pageSize.getHeight();
          doc.text(&quot;Footer text&quot;, data.settings.margin.left, pageHeight - 10);
          doc.text(575, 830, str);
        }
      });
  
      doc.save(&quot;random.pdf&quot;);
    };
  
    return (
      &lt;div className=&quot;App&quot;&gt;
        &lt;h1&gt;Hello CodeSandbox&lt;/h1&gt;
        &lt;h2&gt;Start editing to see some magic happen!&lt;/h2&gt;
        &lt;button onClick={downloadPdf}&gt; Download PDF &lt;/button&gt;
      &lt;/div&gt;
    );
  }
  </code></pre>