Closed vanjoechua closed 3 years ago
how can i open the blob within the same window
hmm one solution is just create an <iframe>
that covers the whole page, and insert the blob file in the <iframe>
,
let me know if that works
Thanks for this idea. It does work.
My app implements a PDF view by clicking on a print button on a form page. When the button is clicked a new tab is opened a the component where the PDF content resides is loaded. I purposely do not load/import the component which has the PDF component inside the same form due to complexity of the overall form component. So the page to print is actually another page. If i set download and preview to false to get the blob how can i open the blob within the same window? What is currently happening is that another page opens to show the PDF even though I have this code in the beforeDownload method:
async beforeDownload({ html2pdf, options, pdfContent }){ await html2pdf().set(options).from(pdfContent).toPdf().get('pdf').then((pdf) => { window.open(pdf.output('bloburl')); }) },