TeamMaestro / pdf-viewer

PDF viewer web component built in StencilJS. Reusable in Angular, Ionic, React, Vue.JS, etc.
MIT License
78 stars 12 forks source link

Feature request: open BLOB #26

Open kustrun opened 5 years ago

kustrun commented 5 years ago

Could you please add support for passing BLOB instead of URL of a file? PDFjs already supports this (https://mozilla.github.io/pdf.js/examples/ look under Hello World using base64 encoded PDF section).

stevexm commented 3 years ago

This would be really nice to have, passing in a BLOB or dataURL instead of a file URL. That way, dynamic pdf generation from within an application would be supported.

stevexm commented 3 years ago

For anyone interested, to open a BLOB (pdf) utilize: this.src = URL.createObjectURL(blob);

See this: MDN Docs, createObjectURL