title: pageBreak not working when using dynamic content with pdfmake js library
body: <p>My attempt :</p>
  
  <pre><code>docDefinition.content.push(
      {
          style: 'header',
          text: String(data.designer)
      }
  );
  </code></pre>
  
  <p>Works fine but I would like to go to a new page each time I add an element :</p>
  
  <pre><code>docDefinition.content.push(
      {
          style: 'header',
          text: String(data.designer),
          pageBreak: 'after'
      }
  );
  </code></pre>
  
  <p>If I try to add a pageBreak in my node by using a loop it doesn't work and I get this error :</p>
  
  <blockquote>
    <p>Uncaught Unrecognized document structure:
    {"alignment":"center","_margin":null}</p>
  </blockquote>
  
  <p>I tried several different way. Even modifing pdfmake.js source file and commenting some lines... impossible to get it work.</p>
  
  <p>Please tell me I can do this without retrieving my content array by writing it in PHP :-/ (only solution I found)</p>
  
  <p>Thank you</p>
  
  <p>EDIT :</p>
  
  <blockquote>
    <p>I found out where the problem was.</p>
    
    <p>I was retrieving a footer with a different content at each page :</p>
  
  <pre><code>var docDefinition = {
      footer: function(currentPage) {
          return {
              text: standnumbers[currentPage - 1],
              alignment: 'center'
          };
      }
  };
  </code></pre>
    
    <p>And when the script was doing the last page and obviously the last
    pageBreak, my array had no more value to create the very last blank
    page.</p>
    
    <p>So by doing this the pdf is finally created :</p>
  
  <pre><code>var docDefinition = {
      footer: function(currentPage) {
          if (currentPage - 1 &lt; standnumbers.length) {
              return {
                  text: standnumbers[currentPage - 1],
                  alignment: 'center'
              };
          } else {
              return {
                  text: "END",
                  alignment: 'center'
              };
          }
      }
  }
  </code></pre>
  </blockquote>