-
I am trying to get my PDF to display in this plugin but I must be making some newbie mistakes. I believe Ive got the data formatted properly but the component never displays and I am not sure why. Im preparing the data like this:
At the end pdfData is what I am using for the :source . I then set the v-if=displayPDF to True but nothing displays. Im sure it's something small but could anyone point me to what Im doing wrong? thank you |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 12 replies
-
Hi @choff5507, I think you're missing the const file = event.target.files[0];
const reader = new FileReader();
reader.onload = () => {
const typedarray = new Uint8Array(reader.result);
};
reader.readAsArrayBuffer(file); Then use this UPD: Added |
Beta Was this translation helpful? Give feedback.
Hi @choff5507,
I think you're missing the
target
of theevent
. Also you don't have to convert the input into base64, since the lib acceptsTypedArray
as a source as well. You can try the following:Then use this
typedarray
as the source for you component. Hope this helps.UPD: Added
readAsArrayBuffer
after noticing in thread.