Skip to main content
derekwatson
Community Expert
Community Expert
Mar 29, 2021 3:20 PM UTC
Question

Cannot get PDF to embed

Been trying to get PDF embedding to work, sample is fine but just cannot do it with a test PDF

    This topic is closed to new replies. Start a new post to keep the conversation going.

    8 replies

    Joel Geraci
    Community Expert
    Community Expert
    Mar 29, 2021 3:31 PM UTC

    Please share your code

    Translate
    derekwatson
    Community Expert
    Community Expert
    Mar 29, 2021 3:33 PM UTC
    <html>
      <head>
        <title>NGS Safety Campaign Summary</title>
      </head>
      <body>
    <div id="adobe-dc-view"></div>
    <script type="text/javascript">
    document.addEventListener("adobe_dc_view_sdk.ready", function(){ 
    var adobeDCView = new AdobeDC.View({clientId: "d33cad69beab44a18228b37c706fd4d7", divId: "adobe-dc-view"});
    adobeDCView.previewFile({
    metaData:{fileName: "<ngs-safety-campaign-test.pdf>"}
    }, {});
    });
    </script>
      </body>
    </html>
    Translate
    Derek Watson
    Joel Geraci
    Community Expert
    Community Expert
    Mar 29, 2021 3:47 PM UTC

    The links to files on Adobe Document Cloud are links to the Document Cloud Viewer, not to the PDF files themselves. You'll need to host your files somewhere else. I have an example of hosting files on Dropbox at this CodePen. 

    Translate