Question
Not able to preview PDF document
Hi,
We are trying to use Adobe PDF Embed API to open PDF file in our web application. We have code like this:
this.adobeDCView = new window.AdobeDC.View(config);
/* Invoke the file preview API on Adobe DC View object */
this.adobeDCView.previewFile({
/* Pass information on how to access the file */
content: {
/* Location of file where it is hosted */
promise: Promise.resolve(buffer),
...
buffer is the ArrayBuffer for the PDF file, we used to use PSPDFKit which takes the same arrayBuffer and load the file without problem.
But when we swtiched to Adobe PDF Embed API, the screen first load with spinning wheel "Opening document 100%", after quite time, it shows error:
"File preview error". On the console, it shows:
core.js:6241 ERROR Error: Uncaught (in promise): Object: {"code":"PREVIEW_RENDERING_FAILED"}
at resolvePromise (zone-evergreen.js:798) [angular]
at resolvePromise (zone-evergreen.js:750) [angular]
at polyfills.js:11394:21 [angular]
at Object.onInvokeTask (core.js:41675) [angular]
at drainMicroTaskQueue (zone-evergreen.js:569) [<root>]
at ZoneTask.invokeTask [as invoke] (zone-evergreen.js:484) [<root>]
at invokeTask (zone-evergreen.js:1621) [<root>]
at globalZoneAwareCallback (zone-evergreen.js:1647) [<root>]


