Hi All,
I have to put pdfmake object:
[ var doc = pdfMake.createPdf(docDefinition) ]
into a canvas object. Basically, I want to display pdf preview before I will print it.
I have tried to use drawImage method from Canvas API but I get message that input stream is invalid.
Is Pdfmake support such operation or do you know suitable alternative?
Thanks
Try this
in html
< iframe id='pdfV' style="width:100%; height: 500px" > iframe>
in js
pdfMake.createPdf(docDefinition).getDataUrl(function (outDoc) {
document.getElementById('pdfV').src = outDoc;
});
Hi Daupawar
Thank you. It is working brilliantly.
Most helpful comment
Try this
in html
< iframe id='pdfV' style="width:100%; height: 500px" > iframe>
in js
pdfMake.createPdf(docDefinition).getDataUrl(function (outDoc) {
document.getElementById('pdfV').src = outDoc;
});