Skip to main content
derekwatson
Community Expert
Community Expert
March 29, 2021
Question

Cannot get PDF to embed

  • March 29, 2021
  • 1 reply
  • 1136 views

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

    This topic has been closed for replies.

    1 reply

    Joel Geraci
    Community Expert
    Community Expert
    March 29, 2021

    Please share your code

    derekwatson
    Community Expert
    Community Expert
    March 29, 2021
    <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>
    Derek Watson
    Joel Geraci
    Community Expert
    Community Expert
    March 29, 2021

    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