Skip to main content
Known Participant
September 1, 2020
Question

PDF Embed API: is there any event that marks the start of display

  • September 1, 2020
  • 1 reply
  • 861 views

I am finding that after the `adobeDCView.previewFile` command is issued, it takes a while even before the gray loading icon appears. Is there any event available to capture the start of the loading? Reason being, we can superlay with our own loader while the embed code works. Thanks

This topic has been closed for replies.

1 reply

Joel Geraci
Community Expert
Community Expert
September 1, 2020

APP_RENDERING_DONE fires when the PDF is rendered completely and the first page is displayed but you might also want to listen for APP_RENDERING_FAILED which will tell you if the PDF fails to render because of an unexpected error. 

R.M.RAuthor
Known Participant
September 2, 2020

Thanks Joel but I cannot seem to find its mention in the documentation (https://www.adobe.io/apis/documentcloud/dcsdk/docs.html). Or have I missed it? I see no examples of how the event gets triggered. It is via some catch block as part of the PreviewFile command? 

Joel Geraci
Community Expert
Community Expert
September 2, 2020

It's listed under "Basic Events" and there's an example of how to register the listener there too. You can register it immediately after creating the view Object.

https://www.adobe.com/devnet-docs/dcsdk_io/viewSDK/howtodata.html#basic-events