Question
Problem: PDF Embed API dc-core loaded twice
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:
<script type="text/javascript">
var pdfurl = <?php echo json_encode($pdfUrl ?? null) ?>;
var pdfname = <?php echo json_encode($pdfName ?? null) ?>;
document.addEventListener("adobe_dc_view_sdk.ready", function(){
var adobeDCView = new AdobeDC.View({clientId: ".............", divId: "adobe-dc-view"});
adobeDCView.previewFile({
content:{location: {url: pdfurl}},
metaData:{fileName: pdfname}
}, {defaultViewMode: "FIT_PAGE", showAnnotationTools: false, showLeftHandPanel: true,
dockPageControls: true});
});
</script>
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
