0

I am trying to remove or disable hyperlinks using syncfusion. I am not getting an error at compile time. I am however getting a runtime error that reads "core.mjs:9095 ERROR TypeError: Cannot read properties of undefined (setting'hyperlinkClick')"

  private getSingleTest() {
    if (!this.testId) return;
    this.testService.getUrl(`get-test-with-file/${this.testId}`)
      .subscribe((data) => {
        this.test = data.test;
        this.initForms(data.test);

        if (data.file) {
          const base64Url = 'data:application/pdf;base64,' + data.file;
          //this.pdfViewer.removeHyperlink();
          this.pdfViewer.hyperlinkClick = false; 
          this.pdfViewer.load(base64Url, '');
        }

        if (data.test) {
          this.onGradeChange(data.test.sectorId)
        }
      });
  }
Zidane
  • 1,696
  • 3
  • 21
  • 35

1 Answers1

0

To enable or disable the hyperlink, you can utilize the #enablehyperlink API. Please refer the code snippet and sample for this.

Code snippet:

viewer.enableHyperlink = false;

Angular Sample: https://stackblitz.com/edit/angular-njjwgs?file=src%2Fapp.component.html,src%2Fapp.component.ts,src%2Fapp.component.css

Typescript sample: https://stackblitz.com/edit/gvhkyr?file=index.ts,index.html