• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Cannot get PDF to embed

Community Expert ,
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

443

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 Expert ,
Mar 29, 2021 Mar 29, 2021

Copy link to clipboard

Copied

Please share your code

Votes

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

Votes

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

Votes

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

 

Votes

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 Expert ,
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.

Votes

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 Expert ,
Mar 29, 2021 Mar 29, 2021

Copy link to clipboard

Copied

Thanks, Is the clientId from Document Cloud or Dropbox?

Votes

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 Expert ,
Mar 29, 2021 Mar 29, 2021

Copy link to clipboard

Copied

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

Votes

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 Expert ,
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.

Votes

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
Resources