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

Adobe document preview fails with CORS error

Community Beginner ,
Dec 27, 2022 Dec 27, 2022

We have a scenario where we have an adobe pdf document which is rendering successfully on UI. This document asks the user to sign digitally. After the user signs this document, it shall render successfully on UI with digital signature but this time the document fails to render on UI with CORS error though we see 'File Preview Error' on browser.

We have already registered our domain with adobe with 'PDF embed API' and used the generated ClientID in our code.

We see following CORS error on console: -

Vinay5E3E_0-1672138152501.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: 'client_id',
    };
    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.

338
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 Beginner ,
Dec 28, 2022 Dec 28, 2022
LATEST

Any update ?

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