Cannot read properties of undefined (reading 'isFullPDFEnabled'

, ,

WebViewer Version: 10.0.0 on a demo license.

Relative newbie here mixing TypeScript and JavaScript.

Can someone help me understand why are I getting the above error? It also looks like I am not able to access any of the PDFNet APIs, as I am getting a null reference. I have these parameters passed to the WebViewer constructor:

 fullAPI: true,
 path: '/webviewer/lib',

This is the line of code causing the issue:

if (window.Core.isFullPDFEnabled()) {
    console.log("FULL PDF is enabled so we should be good to go....attempting to create a PDF OCG layer now ");
}

Please note that if I instead do:

if (Core.isFullPDFEnabled()) {
    console.log("FULL PDF is enabled so we should be good to go....attempting to create a PDF OCG layer now ");
}

I run into the same issue.

And also have the webviewer/lib/core and webviewer/lib/ui folders available under the React app’s public folder.

Hello @e28makaveli,

Thank you for posting on our forum,

That’s quite strange, as even if fullAPI is not set, the isFullPDFEnabled() should still return false.

If you have not already, see our helpful guide here on getting started with fullAPI: Setup | Apryse Documentation

You can also take a look at our public sample typescript project for reference here: GitHub - ApryseSDK/webviewer-typescript-sample

If the above guides do not work, to diagnose further we require the following information:

  1. Full code used, including where the WebViewer instance is created. For example:
  path: "WebViewer/lib",
  fullAPI: true,
  licenseKey: 'Insert commercial license key here after purchase',
}, document.getElementById('viewer'))
  .then(instance => { 
    // WebViewer instance is ready
  });
  1. Are you still able to access other APIs in the Core namespace?
  2. Is this issue reproducible on our latest release (Version 10.12)?
  3. Can you reproduce the issue using our samples (especially on our site)?

Best Regards,
Jacob Romano Carlsen
Web Development Support Engineer
Apryse Software Inc.