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
  • 2255 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.

     

    kevind55123760
    Participant
    August 25, 2020

    Thank you - so can we use the Embed API to embed on our website? Confused still.

    Adobe Employee
    September 7, 2020

    Thank you - but still confused. 

     

    When we go into the embed API, how do we "tell it" what the PDF is and where it is? There's no upload there.

     

    Or maybe I'm catching it - we need to "host" the PDF at DB or Google Docs and then use the API code and put the link to the file inside of Adobe's HTML code?


    Hi, kevind55123760.

    >> we need to "host" the PDF at DB or Google Docs

    You need to host the PDF file anywhere that you can get a direct link to it. This could be your own website. For example, let's say your website has the following simple path structure:

    • /html/myPdfViewer.html
    • /files/myPdfFile.pdf

    The HTML file will have just a few lines of content as described in the documentation my colleague linked to. In particular, for the path structure above, the snippet that refers to the PDF file might look something like this:

    adobeDCView.previewFile(
    {
       content:   {location: {url: "/files/myPdfFile.pdf"}},
       metaData: {fileName: "myPdfFile.pdf"}
    });

    Typically you would upload a PDF file to your site the same way you would upload an HTML file, using the site content management tools available to you. Is that something that you can try?

    Thanks.