Skip to main content
kevind55123760
Participant
August 25, 2020
Question

So Confused with PDF HTML Embed for Website - Help Please :)

  • August 25, 2020
  • 1 reply
  • 2267 views

Wanting to embed HTML code for PDF into website. 

 

Can do Google Docs, but trying to figure out Adobe.

 

Got the API set up and credentials for our website.

 

BUT - we don't see a way to upload a document in adobe.io - and we don't see any different options where our PDFs exist that are already uploaded in the document cloud.

 

Can anybody clarify how to take a document from the document cloud and use the API to generate the embed code? 

 

Very confused - Thanks!!

    This topic has been closed for replies.

    1 reply

    Joel Geraci
    Community Expert
    Community Expert
    August 25, 2020

    Can anybody clarify how to take a document from the document cloud and use the API to generate the embed code? 

     

    You can't. Embed API needs either a direct link to the PDF or a Promise the resolves to a ByteArray for the file to be displayed. The Adobe Document Cloud provides neither. The link to a PDF in DC is not a direct link to a PDF, it is a link to a PDF viewing experience much like Embed API itself.

    However, if you need to host your files on something other than your own web site, you can store your files in Dropbox and use Embed API to display them. You can see that in action at this CodePen.

     

    Participant
    November 9, 2022

    Sorry for my ignoance @8973619 , but can you please let me know how I use your "CodePen" solution for pulling pdfs saved in Dropbox into the Embed API?  I don't know how to read what's on the codepen page.

    Alternatiely, I tried saving a pdf to our squarespace website here: PDF Hosting Page — MedPower  However, when I try using the pdf link (https://medpower.com/s/himycasstatesubmissionfilecreation.pdf) the Adobe PDF Embed API fails.  I can't figure out why. 
    Thanks!
    My PDF Embed API code is below:
    <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: "304002c69695484aa99865059b94aa87", divId: "adobe-dc-view"});
    adobeDCView.previewFile({
    content:{location: {url: "https://medpower.com/s/himycasstatesubmissionfilecreation.pdf"}},
    metaData:{fileName: "himycasstatesubmissionfilecreation.pdf"}
    }, {embedMode: "IN_LINE"});
    });
    </script>
    </p>

    Legend
    November 9, 2022

    I asked you this before, Matt. Is that the exact domain that you mentioned when you got your credentials?