Trying to build a PDF using the JS API PdfMake :
<script type="text/javascript" src="/app/js/vfs_fonts.js"></script>
<script type="text/javascript" src="/app/js/pdfmake.min.js"></script>
Then according to this Helloworld , i run :
var docDef={ content: 'This is an sample PDF printed with pdfMake' }
pdfMake.createPdf(docDef).download('optionalName.pdf');
i've got this error :
Uncaught TypeError: Cannot read property 'Roboto-Regular.ttf' of undefined
I solved the problem importing pdfmake before vfs_fonts.
<script type="text/javascript" src="/app/js/pdfmake.min.js"></script>
<script type="text/javascript" src="/app/js/vfs_fonts.js"></script>