Copy link to clipboard
Copied
Hi team,
First, want to thanks @Raymond Camden for his awesome blog - Using the Adobe PDF Embed API with Vue 3 (raymondcamden.com) , guide me successfully integrate embed API within vue 3 at 1st step.
while, after I'm struggling into step 2 ~ I noticed if use same viewer to load pdf again will throw an error
refer to my screenshot
Uncaught Error: Cannot read properties of undefined (reading 'readFile')
TypeError: Cannot read properties of undefined (reading 'readFile')
at t.syncFile (tsWorker.js:7:2975102)
at tsWorker.js:7:2973824
at workerMain.js:147:690
at Array.forEach (<anonymous>)
at t.acceptRemovedModel (workerMain.js:147:663)
at e._handleMessage (workerMain.js:106:579)
at Object.handleMessage (workerMain.js:106:196)
at e._handleMessage (workerMain.js:104:402)
at e.handleMessage (workerMain.js:103:975)
at e.onmessage (workerMain.js:106:275)
at editor.main.js:146:526
Copy link to clipboard
Copied
I believe I responded via email too, or two people asked similar questions. 😉 I think what you are running into is a bug with the Embed object and reusing it to preview a file. I haven't file that bug yet, but the fix is to recreate the object whenever you preview a new file. I fixed this in my Vue 2 version here, https://codepen.io/cfjedimaster/pen/MWqVxxa?editors=1111. And something similar could be done in Vue 3 of course.
Copy link to clipboard
Copied
yes, thanks Ray. after using new instance to render pdf view every time when pdf reaload. the issue is gone