[Adobe PDF Embed API] AdobeDC is not defined
Reactive icon
Forge component by Matthew Matias

Hi all,

I've used the Forge Asset Adobe PDF Embed API in my mobile and reactive web app. However, in both, I frequently get the following error : AdobeDC is not defined.

The error occurs a lot, and prevents the loading of the PDF. My error logs are saturated by it. The error only occurs the first time that the browser session attempts to load a PDF. And if the error occurs, pressing F5, refreshing the page, or simply repeating the user actions results in a successful PDF open. Whilst that browser is open, any subsequent attempts are fine.

It does not happen on the first PDF open of EVERY new browser session.

It does happen in both mobile and reactive apps.

It's easy to replicate with the following steps:

1) Open a new browser session, or incognito browser window

2) Go to https://dev.earl.health/ED/Home?Shortcode=WMH

3) Click the bottom left image

4) Repeat steps 1-3 until error occurs (Occurs approx one in three times for me).

Given the description. It seems like that error is caused because AdobeDC is not initialised in the browser. Hence why it works for every subsequent attempt, after the first successful load.

I've made sure i'm using the latest version, and all my dependancies are up to date, but the error persists. 

I would be grateful if someone could offer me some direction.

Thank you

Hi Leigh,

It could be that the Embed API JavaScript is being blocked, and the JavaScript to initialise is failing.

When it happens, what do you see in the console logs?


Hi Matt,

If it was being blocked, surely it'd be blocked every time?

Here's an example of one of the errors. 

For anyone subsequently reading.

I added a 2 second delay to the script, which I assume gives time for the module to initialise first. There have been no further incidents in the error logs.

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.