Skip to main content
Participating Frequently
December 1, 2020
Answered

Intermittent PDF viewing

  • December 1, 2020
  • 1 reply
  • 1729 views

Hi.

When I open a incognito page the pdf doesn't show at the first time.

Taking a look at the DOM, The iframe is not loaded (just the first time), just the div that supuse to have the iframe is there.

 

https://i.gyazo.com/c3083ef381a2391fe104a1c60f6c05b3.png

 

I checked the Network tab and Console tab on the web dev tools but is not showing me any error.

I set up the event called "APP_RENDERING_FAILED" but isn't catching nothing.

 

https://i.gyazo.com/cbc6e4736a73d8b641db77818cf0e5bb.png

 

Exist a event to know if the Pdf had troubles and a way to init the "render" again?

 

 

 

This topic has been closed for replies.
Correct answer Shubhanshu Dixit

If you want I cant share you by private my QA enviroment where i have implemented my code.

That works for you?


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

Hope this will help your cause. 

1 reply

Joel Geraci
Community Expert
Community Expert
December 1, 2020

Can you share your code?

Leo5CA8Author
Participating Frequently
December 1, 2020

This is whole my implementation.

https://i.gyazo.com/52b0428f4ac7b587ee4480513078598a.png

It only fails the first time.

Thank you

Joel Geraci
Community Expert
Community Expert
December 1, 2020

Put everything you have inside a document.ready event callback. I suspect the Embed API is ready before the HTML is fully loaded and it can't find the div you reference.