Skip to main content
Participating Frequently
Nov 24, 2020 12:44 PM UTC
Answered

adobe_dc_view_sdk.ready

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

    This topic is closed to new replies. Start a new post to keep the conversation going.
    Shubhanshu DixitCorrect answer
    Adobe Employee
    Dec 3, 2020 8:00 PM UTC

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

    3 replies

    Joel Geraci
    Community Expert
    Community Expert
    Nov 24, 2020 4:19 PM UTC

    You can't rewrite that section?

    Translate
    Participating Frequently
    Nov 24, 2020 5:12 PM UTC

    Yeah I decided to rewrite it in the end and load the script dynamically in our PDFAdapter class.
    Thanks

    Rob

     

    Translate
    Shubhanshu DixitCorrect answer
    Adobe Employee
    Dec 3, 2020 8:00 PM UTC

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