Skip to main content
Participant
January 20, 2021
Question

PDF Embed API - File Preview Not Available

  • January 20, 2021
  • 2 replies
  • 1206 views

Greetings! 

I am having trouble getting the PDF embed API to work on my site. I keep encountering the message "File Preview Not Available" with any PDF file I try. The domain is a test site I created with Weebly https://corporatesampleintranetpage.weebly.com/.

The code I am using is: 

 

<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: "<98a6ee14c3d64f3a8eae67ddf3534fc1>", divId: "adobe-dc-view"});
adobeDCView.previewFile({
content:{location: {url: "https://documentcloud.adobe.com/link/documents/files/sample.pdf"}},
metaData:{fileName: "ACORD.pdf"}
}, {});
});
</script>

 

 

Any and all help is VERY MUCH APPRECIATED! 

Beth

    This topic has been closed for replies.

    2 replies

    Participant
    March 15, 2021

    Beth you have enclosed your client ID in < > 

     

    <98a6ee14c3d64f3a8eae67ddf3534fc1>

     

    It should be without the < >, like this:

     

    98a6ee14c3d64f3a8eae67ddf3534fc1

    Joel Geraci
    Community Expert
    Community Expert
    January 21, 2021

    The URL you are pointing to is not a direct link to a PDF. It is a link to a view of the PDF file stored in Document Cloud. At the time of this writing, there is no method of accessing the bytes of a PDF or creating a direct link to a PDF stored in Adobe Document Cloud. You'll need to host your PDF file somewhere else.