title: pdfmake generates blank pdf
body: <p>I'm trying to use <code>pdfmake</code> for generating pdf from html with <code>html2canvas</code> in <code>angular2</code>
  here is my code this is a sample code what im trying to do original html contains dynamic data from APIs and whole page is too long thats why I tried to divide it with div</p>
  
  <p><strong>component.ts</strong></p>
  
  <pre><code>createPdf(): void {
          var data_1;
          var data_2;
          var data_3;
          var data_4;
          var data;
       var p1 = new Promise((resolve, reject) =&gt; { 
          html2canvas(document.getElementById('home'), {
                  onrendered: function (canvas) {
                    console.log(canvas);
                    canvas.height = 500;
                    data_1 = canvas.toDataURL();
                      resolve(data_1);
                  }
              }); 
        });  
  
       var p2 = new Promise((resolve, reject) =&gt; { 
           var div = document.getElementById('terms');
          html2canvas(div, {
                  onrendered: function (canvas) {
                  canvas.height = div.clientHeight;
                    data_2 = canvas.toDataURL();
                      resolve(data_2);
                  }
              }); 
        });
       Promise.all([p1, p2]).then(values =&gt; { 
            html2canvas(document.getElementById('optionals'), {
              onrendered: function (canvas) {
                  canvas.height = 500;
                  var data = canvas.toDataURL();
                  console.log(canvas);
                   var docDefinition = {
                      content: [
                          {
                              image: data_1,
                              width: 450,
                          },
                          {
                              image:data_2,
                              width: 500
                          },
                          {
                              image:data,
                              width:550
                          }
                          ]
                  };
                  console.log(docDefinition);
                  setTimeout(() =&gt; {
                  pdfMake.createPdf(docDefinition).download("travel.pdf");
                 },1500);
              },
              removeContainer:true
          },
  
  
          );
        }, reason =&gt; {
          console.log(reason)
        });
      }
  </code></pre>
  
  <p><strong>component.html</strong></p>
  
  <pre><code>&lt;a href="javascript:void(0)" (click)="createPdf()"&gt;
     &lt;div class="quotation-info"&gt;
        &lt;i class="fa fa-download"&gt;&lt;/i&gt;
  
     &lt;/div&gt;
  &lt;/a&gt;
  &lt;div class="row"&gt;
  &lt;div class="col-md-12"&gt;
  
  &lt;div id="optionals"&gt;
     Contrary to popular belief, Lorem Ipsum is not simply random text. It has roots in a piece of classical Latin literature from 45 BC, making it over 2000 years old. Richard McClintock, a Latin professor at Hampden-Sydney College in Virginia, looked up one of the more obscure Latin words, consectetur, from a Lorem Ipsum passage, and going through the cites of the word in classical literature, discovered the undoubtable source. Lorem Ipsum comes from sections 1.10.32 and 1.10.33 of "de Finibus Bonorum et Malorum" (The Extremes of Good and Evil) by Cicero, written in 45 BC. This book is a treatise on the theory of ethics, very popular during the Renaissance. The first line of Lorem Ipsum, "Lorem ipsum dolor sit amet..", comes from a line in section 1.10.32.
  
     Contrary to popular belief, Lorem Ipsum is not simply random text. It has roots in a piece of classical Latin literature from 45 BC, making it over 2000 years old. Richard McClintock, a Latin professor at Hampden-Sydney College in Virginia, looked up one of the more obscure Latin words, consectetur, from a Lorem Ipsum passage, and going through the cites of the word in classical literature, discovered the undoubtable source. Lorem Ipsum comes from sections 1.10.32 and 1.10.33 of "de Finibus Bonorum et Malorum" (The Extremes of Good and Evil) by Cicero, written in 45 BC. This book is a treatise on the theory of ethics, very popular during the Renaissance. The first line of Lorem Ipsum, "Lorem ipsum dolor sit amet..", comes from a line in section 1.10.32.
     &lt;img src="https://images.pexels.com/photos/47730/the-ball-stadion-football-the-pitch-47730.jpeg" class="img-responsive"&gt;
     The standard chunk of Lorem Ipsum used since the 1500s is reproduced below for those interested. Sections 1.10.32 and 1.10.33 from "de Finibus Bonorum et Malorum" by Cicero are also reproduced in their exact original form, accompanied by English versions from the 1914 translation by H. Rackham.
  &lt;/div&gt;
  &lt;div id="home"&gt;
     Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. 
     &lt;p&gt;It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.&lt;/p&gt;
  &lt;/div&gt;
  &lt;div id="terms"&gt;
     Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book.
     &lt;p&gt; It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.&lt;/p&gt;
     &lt;p&gt;
     Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.&lt;/p&gt;
     Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.
     &lt;p&gt;
     Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.&lt;/p&gt;
     Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.
     &lt;p&gt;
     Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.&lt;/p&gt;
  
  &lt;/div&gt;
  &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p><code>data_1</code> and <code>data_2</code> is not printing in pdf only <code>data</code> from the <code>docDefinition</code> is printing other 2 are printing blank.</p>
  
  <p>What I'm missing?</p>