Skip to main content
Participant
November 6, 2022
Question

How do I host pdfs that I want to use with Adobe PDF Embed API?

  • November 6, 2022
  • 2 replies
  • 651 views

I added the demo script below to my site with my client ID and it pulls in the pdf sample file as expected (URL in red).  I then added my own pfd URL and it fails to work.  I get a "File preview not available, please reload to try again" error. Here's the pdf I was trying to display:  https://medpower.com/s/himycasstatesubmissionfilecreation.pdf

Do I have to save the source PDF files in a special way or on a special website before I can pull them in using the PDF Embed API? I don't understand why the demo URL works, but mine does not.  Any help you can provide is greatly apprecaited!

 

FYI, here's the code I used that substitutes our pdf URL:

<div id="adobe-dc-view" style="width: 800px;"></div>
<p>
<script src="https://documentservices.adobe.com/view-sdk/viewer.js"></script>
<script type="text/javascript">
document.addEventListener("adobe_dc_view_sdk.ready", function(){
var adobeDCView = new AdobeDC.View({clientId: "XXXXXXXXXXXXXX", divId: "adobe-dc-view"});
adobeDCView.previewFile({
content:{location: {url: "https://medpower.com/s/himycasstatesubmissionfilecreation.pdf"}},
metaData:{fileName: "himycasstatesubmissionfilecreation.pdf"}
}, {embedMode: "IN_LINE"});
});
</script>
</p>

    This topic has been closed for replies.

    2 replies

    Legend
    November 6, 2022

    PS and to keep it simple use the exact same domain name for the web page too. Otherwise you will get security (CORS) errors. If I have that right.

    Participant
    September 5, 2023

    Can you tell me more about the steps? connections game

    Legend
    November 6, 2022

    As I understand it, when you create credentials you have to fill in the exact domain name where your files will reside. And it must be exact. For example, mxdpower.com is not a substitute for www.mxdpower.com.

    Raymond Camden
    Community Manager
    Community Manager
    September 5, 2023

    Actually no - you can use foo.com and it will work on *.foo.com. That's what I recommend.