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

PDF Embed API: Multiple embeds on the same page

New Here ,
Apr 12, 2021 Apr 12, 2021

Hi!

 

I'm using the PDF Embed API with React. And it's working perfectly when I only have embed on the page. But when I try to add another one on the page I get this error in my network tab.

Tech5EDE_0-1618248939805.pngexpand image

I'm using the Full Window mode if that helps.

Are there any suggested ways I can solve this issue? 

 

Thank you in advance,

TOPICS
PDF Embed API , PDF Services API
2.5K
Translate
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

correct answers 1 Correct answer

Community Expert , Apr 12, 2021 Apr 12, 2021

You'll need to use two different variables for the DC View object and then it will work.

Translate
New Here ,
Apr 12, 2021 Apr 12, 2021

Sorry, I realize that the image is way too small.

 

Translate
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 ,
Apr 12, 2021 Apr 12, 2021

You'll need to use two different variables for the DC View object and then it will work.

Translate
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 ,
Dec 24, 2021 Dec 24, 2021

the same issue is with me, can u please provide me the source code

Translate
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
Explorer ,
Oct 22, 2023 Oct 22, 2023

I am able to render multiple embeded pdfs on a single page using IN_LINE embed method, just mounting them on different div ids.  

I admit that i am not sure if this is causing some problems as the pdf's don't render all the time, sometimes reaching 100% and failing with nothing in the UI that would say so.

 

I am using Vue whih has a data object and a variable called adobeDCView.

@Joel3 Do you recommned that we create a new adobeDCView for each embed on the same page?

 

 

 

this.adobeDCView = new AdobeDC.View({
clientId: process.env.VUE_APP_PDF_KEY,
divId: `pdf-view-${index}`,
});

this.adobeDCView.previewFile(
{
content: { location: { url: item.url } },
metaData: { fileName: item.fileName },
},
{
embedMode: "IN_LINE",
showDownloadPDF: false,
showAnnotationTools: true,
enableLinearization: true,
}
);

 

Translate
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
Explorer ,
Sep 26, 2024 Sep 26, 2024

Can we  use the same adobeDCView.preview file instance and use different divId names?  Or is the way suggested above is to create completely new instances of adobeDCView for each pdf.. 

Translate
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 Employee ,
Sep 27, 2024 Sep 27, 2024
LATEST

As the result of AdobeDC.View is tied to a div, you should normally just use 2 instances. Here is a CodePen showing it: https://codepen.io/cfjedimaster/pen/ZEgGvor

 

Translate
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