adobe_dc_view_sdk.ready

Community Beginner ,
Nov 24, 2020

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

Views

95

Likes

Translate

Translate

Report

Report
Reply
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

1 Correct Answer

Adobe Employee , Dec 03, 2020
Shubhanshu Dixit Adobe Employee , Dec 03, 2020
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(); }); }

Likes

Translate

Translate
Jump to answer Jump to answer
Adobe Community Professional ,
Nov 24, 2020

Copy link to clipboard

Copied

You can't rewrite that section?

Likes

Translate

Translate

Report

Report
Reply
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Community Beginner ,
Nov 24, 2020

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

 

Likes

Translate

Translate

Report

Report
Reply
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Adobe Employee ,
Dec 03, 2020

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();
                });
            }

Likes

Translate

Translate

Report

Report
Reply
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more