Cannot get PDF to embed

Community Beginner ,
Mar 29, 2021 Mar 29, 2021

Copy link to clipboard

Copied

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

Views

89

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Community Professional ,
Mar 29, 2021 Mar 29, 2021

Copy link to clipboard

Copied

Please share your code

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Mar 29, 2021 Mar 29, 2021

Copy link to clipboard

Copied

<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>

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Community Professional ,
Mar 29, 2021 Mar 29, 2021

Copy link to clipboard

Copied

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

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Mar 29, 2021 Mar 29, 2021

Copy link to clipboard

Copied

I tried that first but thought it may have to be on Document Cloud when it didn't work

 

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Community Professional ,
Mar 29, 2021 Mar 29, 2021

Copy link to clipboard

Copied

The default share links from dropbox don't work for the same reason that PDF files in Document Cloud don't work. The CodePen has a function called directLinkFromDropboxLink(). This function modifies the share link to a direct link. Try using Dropbox again but with my code sample.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Mar 29, 2021 Mar 29, 2021

Copy link to clipboard

Copied

Thanks, Is the clientId from Document Cloud or Dropbox?

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Mar 29, 2021 Mar 29, 2021

Copy link to clipboard

Copied

Not usually having to get involved in coding... A tad rusty!!!

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Community Professional ,
Mar 29, 2021 Mar 29, 2021

Copy link to clipboard

Copied

LATEST

The clientID is for CodePen. Create your credential for the domain hosting your HTML, not the PDF.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines