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

File preview error

New Here ,
Nov 23, 2022 Nov 23, 2022

Copy link to clipboard

Copied

Hi, we are facing a similar error. We see the same 'File preview error' in browser and we see CORS error in console as follow: -

Rituraj27270830zjj0_0-1669193045833.png

Our code looks like as follow: -

readyPromise: Promise<any> = new Promise((resolve) => {
    if (window.AdobeDC) {
      resolve('');
    } else {
      document.addEventListener('adobe_dc_view_sdk.ready', () => {
        resolve('');
      });
    }
  });

previewFile(divId: string, documentUrl: string) {
    const config: any = {
      clientId: '548463e49415464db30c3eea90b757fd',
    };
    if (divId) {
      config.divId = divId;
    }
    this.adobeDCView = new window.AdobeDC.View(config);

    const previewFilePromise = this.adobeDCView.previewFile({
      content: {
        location: {
          url: 'https://secure.eu1.adobesign.com/document/cp/3AAABLblqZhAnnaCqNZcTFsYRHPJjIGS6IJiY6aGNHtpJ21P-AkJNdvQue_M5bDRKtTGcbIuYUnM-E70FsHemg3CZ_miEqxNv/document.pdf'
        },
      },
      metaData: {
        fileName: 'DemoFile.pdf',
      }
    }, {
      showAnnotationTools: false,
      showLeftHandPanel: false
    });

    return previewFilePromise;
  }

Kindly help. We are relatively new and stuck at this.

Views

154

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
LEGEND ,
Nov 23, 2022 Nov 23, 2022

Copy link to clipboard

Copied

If you don't want to get into the complicated world of CORS, you must have the link and the PDF on the same domain. 

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
New Here ,
Nov 23, 2022 Nov 23, 2022

Copy link to clipboard

Copied

@Test Screen Name  Hey but this is our use case 😞 Any suggestions for this?

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
LEGEND ,
Nov 23, 2022 Nov 23, 2022

Copy link to clipboard

Copied

Ok, then you need to set up CORS correctly. By default, one domain cannot load items from a different domain. This is very important web security, designed to protect from impersonation.

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
New Here ,
Nov 23, 2022 Nov 23, 2022

Copy link to clipboard

Copied

We do have CORS confiuration in place and this had been working fine since quite some time. But now all of a sudden this started giving out CORS error. I searched for this on internet and concluded that adobe might have updated this in some recent time. Also that I need to allow my website origin on the PDf resource which in this case is adobe. That I need to use their admin panel to allow my website. But am not sure where exactly in adobe demo panel I shall make this change.

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
New Here ,
Dec 08, 2022 Dec 08, 2022

Copy link to clipboard

Copied

LATEST

Any suggestions on this one? Can someone please tell as how to add my website on adobe admin panel to get rid of my issue?

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
Resources