title: Call a function from within pdfMake in Ionic2?
body: <p>I have the following pdfMake code block in my ionic app:</p>
  
  <pre><code>pdfMake.createPdf(docDefinition).getBase64(function (encodedString) {
      pdfEncoded = encodedString;
      console.log(pdfEncoded);
      this.sendValue(pdfEncoded);
  }
  </code></pre>
  
  <p>The error I am getting is: </p>
  
  <blockquote>
    <p>Cannot read property 'sendValue' of undefined.</p>
  </blockquote>
  
  <p>What do I need to do to call the <code>sendValue()</code> function? I am able to <code>console.log</code> the value of <code>pdfEncoded</code> but unable to pass the value to a function. Can someone let me know what I am doing wrong. </p>
  
  <p>Thank you,
  A</p>