Copy link to clipboard
Copied
Is there some property that can be checked to see if the sdk is ready rather than listening for the event.
Would just checking for the existence of adobeDCView be enough?
Reason for this is because of the way our app is constructed the sdk gets loaded and completes before the code that attaches the listener, so it never hears the event.
Thanks
Rob
You can check the PDF Embed API initialization in the following way as well
if (window.AdobeDC) {
previewFile();
} else {
/* Wait for Adobe Document Services PDF Embed API to be ready */
document.addEventListener("adobe_dc_view_sdk.ready", () => {
previewFile();
});
}
Copy link to clipboard
Copied
You can't rewrite that section?
Copy link to clipboard
Copied
Yeah I decided to rewrite it in the end and load the script dynamically in our PDFAdapter class.
Thanks
Rob
Copy link to clipboard
Copied
You can check the PDF Embed API initialization in the following way as well
if (window.AdobeDC) {
previewFile();
} else {
/* Wait for Adobe Document Services PDF Embed API to be ready */
document.addEventListener("adobe_dc_view_sdk.ready", () => {
previewFile();
});
}