• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
1

adobe_dc_view_sdk.ready

Explorer ,
Nov 24, 2020 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

3.1K

Translate

Translate

Report

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

correct answers 1 Correct answer

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

Votes

Translate

Translate
Community Expert ,
Nov 24, 2020 Nov 24, 2020

Copy link to clipboard

Copied

You can't rewrite that section?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Nov 24, 2020 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

 

Votes

Translate

Translate

Report

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

Copy link to clipboard

Copied

LATEST

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

Votes

Translate

Translate

Report

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