Problem: PDF Embed API dc-core loaded twice
Copy link to clipboard
Copied
Hi,
yesterday my PDF Embed API stopped working properly for no reason.
If I load it more than once in the same page, without refreshing, it gives me the error 'index.js:44 Uncaught dc-core loaded twice'.
I didn't edit anything about it.
This is the code:
This is the log:
index.js:44 Uncaught dc-core loaded twice
haRa @ index.js:44
__webpack_require__ @ bootstrap:19
EbfC @ AdobeDCViewBase.js:13
__webpack_require__ @ bootstrap:19
(anonymous) @ ViewSDKInterface.js:2
(anonymous) @ ViewSDKInterface.js:2
(anonymous) @ ViewSDKInterface.js:2
Any suggestions gratefully received.
Cheers, Daniel
Copy link to clipboard
Copied
We're getting the same issue, nothing changed on the server just started happening.
Copy link to clipboard
Copied
Does the error go away if you have the script tag only once on your page? I mean the one loading the library.
Copy link to clipboard
Copied
Tried this but no luck, either doesn't load and no error or doesn't load and errors.
Copy link to clipboard
Copied
I have been having the same issue since the 14th as well. Most of my larger PDFs with annotations do not load. I have tested it with samller image based PDF files and those have been able to load. Been attempting to troubleshoot but have not found a resolution yet.
Copy link to clipboard
Copied
I am also seeing this, I utilize the embed on an LMS, and have the core loading each time an embed is on a page, if i have subsequent pages that i move through it stops loading properly and a refresh must occur for it to display, am wondering if a variable could be set to check if the core is already loaded first before it try's a second time?
Copy link to clipboard
Copied
@CSumner102 You can check for window.AdobeDC.
@TylerL24 Your comment - are you ONLY talking about cases where the script tag is loaded twice? If not, please open a new thread.
@Crew31128935gi26 So do you get the error with 2 + embeds, even if you have 1 script tag?
Copy link to clipboard
Copied
@Raymond Camden yes i was getting the dc-core loaded twice in the console, I just edited my code to this
<script type="text/javascript">
function initializeAdobeDCView() {
var adobeDCView = new AdobeDC.View({clientId: "Your ID", divId: "adobe-dc-view"});
adobeDCView.previewFile({
content: {
location: {url: "Your File URL"}
},
metaData: {fileName: "Your File Name"}
}, {
embedMode: "FULL_WINDOW",
defaultViewMode: "FIT_WIDTH",
showFullScreen: true,
showAnnotationTools: false,
showZoomControl: true,
focusOnRendering: true,
showDownloadPDF: true
});
}
function loadViewerScript() {
if (window.AdobeDC && window.AdobeDC.View) {
initializeAdobeDCView();
} else {
var viewerScript = document.createElement('script');
viewerScript.src='https://documentservices.adobe.com/view-sdk/viewer.js';
viewerScript.onload = initializeAdobeDCView;
document.body.appendChild(viewerScript);
}
}
loadViewerScript(); // Load the Adobe DC View SDK and initialize the viewer
</script>
and now it checks to see if the core is already loaded before it try's to again.
Copy link to clipboard
Copied
This is still an issue, the code i have above is fine as a temporary fix, but i have 400 web pages that have the embed on and to implement this code on all these pages is going to take me some time, and i am sure i will still see some other issues.
What exactly has happened to cause this, up to a couple of weeks ago this was not an issue for our platform..
Copy link to clipboard
Copied
looking at the online guide i see that the library is <script src="https://acrobatservices.adobe.com/view-sdk/viewer.js"></script> has it been changed?
Copy link to clipboard
Copied
Is there a way to revert to the old script, similar to how the last version in the link works, for example, like jQuery
src="https://acrobatservices.adobe.com/view-sdk/viewer.js"
src="jquery-3.7.1.min.js">
Copy link to clipboard
Copied
Nope.
Copy link to clipboard
Copied
i want back to version before because https://community.adobe.com/t5/acrobat-services-api-discussions/pdf-embed-api-annotations-api-annota... ,
Copy link to clipboard
Copied
I understand why you want it, but we don't support it.
Copy link to clipboard
Copied
So any solution about that problem or Adobe Embed will be without steakyNote ?
Copy link to clipboard
Copied
I do not have new information for you.
Copy link to clipboard
Copied
I'm still a bit confused as to what is causing this. You had 2 script tags, and 2 uses of embed, on a page, right? Can you maybe build a one page demo you can share the code with so I can recreate the issue?
Copy link to clipboard
Copied
As for the URL, yes, it's a new URL, but the library has not changed, outside of what is documented here: https://developer.adobe.com/document-services/docs/overview/pdf-embed-api/releasenotes/
Copy link to clipboard
Copied
from what i can tell the lms loads the <script src="https://documentservices.adobe.com/view-sdk/viewer.js"></script> and my embed code, on my first page, and when I navigate to another page that has a different PDF embedded on and also the <script src="https://documentservices.adobe.com/view-sdk/viewer.js"></script> it then show a blank embed, no loading of the content or anything, and when i check the console it says dc-core loaded twice, its like something is being held onto when the next page is loaded
Copy link to clipboard
Copied
Well, I can't really help unless you have a reproducable case. If your CMS is doing something weird, it's possible it worked before but won't now. Basically, I need an HTML page that demonstrates the issue and I can either suggest a workaround, or file a bug report.
Copy link to clipboard
Copied
It seems we have caused some confusion among us. There has been an inadvertent mix-up between the Learning Management System (LMS) and the Content Management System (CMS). As someone with two decades of experience in the field of technology, I believe it is crucial to clarify this distinction.
Now, let's turn our attention to the real issue at hand. It is not directly related to the platform we are currently utilizing or the development environment we are working within. Instead, my focus lies on the integration of the Adobe embed API into our HTML pages, a reliable approach that I have successfully implemented for over 2.5 years.
So to address this effectively, I have decided to replicate the entire setup in an alternate environment. In doing so, I can grant you access, enabling you to observe the situation firsthand. By collaborating in this manner, we can perhaps identify and resolve the issue that has presented itself.
Copy link to clipboard
Copied
Ok just realized I can send you to here https://learn.forcepoint.com/pages/microlearning-catalog, this is a catalog of articles and videos we have that are public, so if you click on any of the items referred to as HackStacks, this will load a page where we have an embedded pdf, it may or may not load the first time, and then if you navigate back with the browsers back button to the catalog again and click a different HackStack you will probably see in the console the error: Uncaught dc-core loaded twice
A refresh on these pages will generally make the pdf display, but again navigate to another HackStack and it will be blank and the error will be in the console. This is what our customers are now reporting to us, and we have over 400 of these across our site, up to a couple of weeks ago we did not have this issue.
Copy link to clipboard
Copied
sorry i meant Uncaught dc-core loaded twice'.
Copy link to clipboard
Copied
We are running into the same issue. We have our PDF viewer in a side modal. If a user closes then opens that side modal a second time. `Uncaught dc-core loaded twice` error shows and the viewer does not work. We remove the script tag when the user closes the modal. But now it looks like we also have to remove the following from the window object to clean up what the script adds.
- window.AdobeDC
- window.adobe_dc_sdk
- window.adobe_dc_view_sdk
Copy link to clipboard
Copied
@Carl the enforcer As with CSumner102, I need a reproducable case in order to help.

