• Global community
    • Language:
      • Deutsch
      • English
      • EspaƱol
      • FranƧais
      • PortuguĆŖs
  • ę—„ęœ¬čŖžć‚³ćƒŸćƒ„ćƒ‹ćƒ†ć‚£
    Dedicated community for Japanese speakers
  • ķ•œźµ­ ģ»¤ė®¤ė‹ˆķ‹°
    Dedicated community for Korean speakers
Exit
0

Issue with two PDF embedded into the same page

New Here ,
Jan 23, 2022 Jan 23, 2022

Copy link to clipboard

Copied

I unsuccessfully tried to embed two different PDF files on the same page, using for both the files I used the Adobe API and particularly the code below (consider the same code with two different file names and paths on the same page):

<center>
<div id="adobe-dc-view" style="height: 360px; width: 500px;"></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: "<code>", divId: "adobe-dc-view"});
adobeDCView.previewFile({
content:{location: {url: "https://www.domain.com/filename.pdf"}},
metaData:{fileName: "filename.pdf"}
}, {embedMode: "SIZED_CONTAINER", showDownloadPDF: false, showPrintPDF: false, 
showFullScreen: false});
});
</script>
</center>

PDF files are not visible and I see an error message.
I have to remove one of the two codes, and in that case, only one PDF is visible.
Any solution?

Views

604

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
New Here ,
Jan 28, 2022 Jan 28, 2022

Copy link to clipboard

Copied

Is there anybody who can answer me?

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
LEGEND ,
Jan 28, 2022 Jan 28, 2022

Copy link to clipboard

Copied

 I have no info except to suggest you post the WHOLE code to show two PDFs in your case. Don't leave people to guess what you changed - clearly you can't just run the same unchanged code twice, but it's best to provide a simpler test.

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
New Here ,
Jan 28, 2022 Jan 28, 2022

Copy link to clipboard

Copied

Thank you for your reply.
The code is the one I posted. It's simply to reproduce the situation by applying twice the same 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
LEGEND ,
Jan 29, 2022 Jan 29, 2022

Copy link to clipboard

Copied

I never used  this API, but I would not expect exact duplication to work. Surely the DIV ID needs to be unique?

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
New Here ,
Jan 31, 2022 Jan 31, 2022

Copy link to clipboard

Copied

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
LEGEND ,
Jan 31, 2022 Jan 31, 2022

Copy link to clipboard

Copied

But surely that code is only including it once. Did you even try changing the DIV id in the second copy ?

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
New Here ,
Jan 31, 2022 Jan 31, 2022

Copy link to clipboard

Copied

Yes, I did it.

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
LEGEND ,
Jan 31, 2022 Jan 31, 2022

Copy link to clipboard

Copied

LATEST

Ok, please show the complete code - both parts. People can't debug code that they cannot see. 

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