I am generating a Pdf-file with PdfMake and encode this in base64 string array with the method getBase46()
like this:
let base64: string;
this.pdf.createPdf(buildPdf(pdfModel)).getBase64(
function(encodedString) {
base64 = encodedString;
console.log(base64); // base64 is not undefined and is a some string
}
);
console.log(base64); // base64 is undefined here
How can I get the variable base64
outside the function
?