Skip to main content
Participant
July 29, 2021
Question

Trouble with embedding code file into website

  • July 29, 2021
  • 1 reply
  • 254 views

Hi all, 

I've been stuck or a while. I used the sample code from the adobe website for embedding a pdf file but keep getting an error message about client id and not having access, which I've checked and tripple checked. Any idea what I might be doing wrong? I added my domain to my account as well.

 

The only thing I edited were 1) the client id, 2) the file url and 3) the document name, which I've xxxx out for  the purpose of this post. Any idea what I might be doing wrong?

 

<div id="adobe-dc-view" style="width: 800px;"></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: "xxxx",
            divId: "adobe-dc-view"
        });
        adobeDCView.previewFile({
            content: { location: { url: "https://documentcloud.adobe.com/link/xxxx" } },
            metaData: { fileName: "template.pdf" }
        }, {
            embedMode: "IN_LINE",
            showDownloadPDF: false,
            showPrintPDF: false
        });
    });
</script>

 

 

    This topic has been closed for replies.

    1 reply

    Joel Geraci
    Community Expert
    Community Expert
    July 29, 2021

    The url yiou have to the PDF on Document Cloud isn't a direct link to the PDF. It's a link to the Document Cloud viewer that displays your PDF. Unfortunately, we can't use those links. You'll need to store your PDF in a location that Embed API can access directly. I haven example at this CodePen showing how to display a file stored in Dropbox but any URL that causes the PDF file to be downloaded will work.