Skip to main content
Participant
October 2, 2020
Question

API stops working after a page refresh

  • October 2, 2020
  • 1 reply
  • 501 views

I hope someone can help with this. (Please keep in mind that my technical knowledge is limited)

I created this test page:
https://www.posterpresentations.com/research/PI1065/DELETEME/basit-iqbal-php-framework.html

 

The PDF displays properly but after you refresh the page it disapears.... 

I tested is in multople browsers with no luck.

 

Here is the code I use:

 

<div id="adobe-dc-view"></div>
<script src="https://documentcloud.adobe.com/view-sdk/main.js"></script>
<script type="text/javascript">
document.addEventListener("adobe_dc_view_sdk.ready", function(){
var adobeDCView = new AdobeDC.View({clientId: "c0ed52a26e894bb988b9242e11480d7c", divId: "adobe-dc-view"});
adobeDCView.previewFile({
content:{location: {url: "https://www.posterpresentations.com/research/PI1065/DELETEME/PHP%20framework.pdf"}},
metaData:{fileName: "PHP Framework"}
}, {defaultViewMode: "FIT_WIDTH", showAnnotationTools: false});
});
</script>

 

Any suggestions?

 

    This topic has been closed for replies.

    1 reply

    Joel Geraci
    Community Expert
    Community Expert
    October 5, 2020

    I only see the problem when I clear the browser cache prior to refreshing. When I just refresh, it works. My suggestion is to move the code that loads the preview to the end of your page and wrap it in a document.redy event.

    akotoulasAuthor
    Participant
    October 15, 2020

    Thank you. I got it to work.