Js.express watermark still appearing on licensed version

Which product are you using?
PDF.js Express Plus
PDF.js Express Version
(index) Value
UI version ‘8.7.0’
Core version ‘8.7.4’
webviewer.min.js ‘8.7.4’
Build ‘Ni8xNi8yMDIzfDhhZjQyYTgwOTU=’
WebViewer Server false
Full API false
Detailed description of issue
We have recently integrated PDF.js Express with our react application by following the tutorial. We have a license for PDF.js Express Plus and we believe to have configured it properly, but the watermark does not disappear and we have trouble figuring out why
What we have validated:

  • the license key is picked up and sent to https://auth.pdfjs.express/?key=… . The respoonse is 200 with a payload { key: … }
  • made sure that only @pdftron/pdfjs-express is installed
  • the domain is properly configured in the dashboard
  • ran the application in localhost and we get the This license key is currently registered to foo.infra and the domain matches. To be noted, this is an internal domain, it is not available to the outside world
    the request is sent from a subdomain: subdomain.dev.foo.infra
  • tried the manual integration approach, but the watermark is still there
    Expected behaviour
    The watermark to disappear in upper environments. We are aware that on localhost it will remain.
    Does your issue happen with every document, or just one?
    With every document
    Link to document
    Unable to provide link to the application or the document
    Code snippet
    // @ts-ignore
    import WebViewer from ‘@pdftron/pdfjs-express’;
    WebViewer(
    {
    path: ‘path’,
    licenseKey: ‘key’,
    extension: ‘pdf’,
    preloadWorker: ${WebViewer.WorkerTypes.PDF},
    },
    viewer.current
    ).then((instance: any) => {
    pdfViewerInstance.current = instance;
    });
    pdfViewerInstance.current.loadDocument(url, {
    extension: ‘pdf’,
    });

Hello zhales,

Thank you for contacting pdf.js express forums.

Did this issue ever occur before or is this only after integrating PDF.js Express? If so, try clearing the cache.

I know you mentioned that only @pdftron/pdfjs-express is installed, but make sure to remove all references of pdfjs-express-viewer.

If possible, please provide a link to the production.

Best Regards,
Darian Chen

Hi, thanks for getting back.

We have used only PDF.js Express Plus, we have not used the pdfjs-express-viewer.

I have used multiple browsers with incognito mode, it behaves the same. I also have disabled the cache in developer mode (Chrome).

The application is on our internal infrastructure and I cannot provide access to it unfortunately. I am hoping you can check some logs on your side and tell me if there is any error on the domain setup or with the license.

What we can probably do (if this is an option for you) is setup a call and use share screen to show you the behavior.

Thank you !

Hi zhales,

Thank you for the information. However, before we set up a call, we require a minimal sample of the project and a sample file to test. The file can be a blank one as long as the watermark issue is still reproducible.

Also, please provide a screenshot of any console errors.

Thank you.

Best Regards,
Darian Chen

hi,
my colleague was able to replicate the issue using one of the samples. it seems to be related to subdomains, but here is what we were able to test:
we updated the code from one of the samples to replicate what we are doing in our app (we download the file, create a blob and pass that to WebViewer in a loadDocument call) :

\samples\viewing\viewing\viewing.js
fetch('https://pdftron.s3.amazonaws.com/downloads/pl/demo-annotated.pdf')
  .then(res => res.blob()) // Gets the response and returns it as a blob
  .then(blob => {
    // Here, I use it to make an image appear on the page
    const url = URL.createObjectURL(blob);
    WebViewer(
      {
        path: '../../../lib',
        licenseKey: '........',
        extension: 'pdf',
        preloadWorker: WebViewer.WorkerTypes.PDF,
      },
      document.getElementById('viewer')
    ).then(instance => {
      setTimeout(() => {
        instance.loadDocument(url, { extension: 'pdf' });
      }, 2000);
      
      samplesSetup(instance);
    
      document.getElementById('select').onchange = e => {
        instance.UI.loadDocument(e.target.value);
      };
    
      document.getElementById('file-picker').onchange = e => {
        const file = e.target.files[0];
        if (file) {
          instance.UI.loadDocument(file);
        }
      };
    
      document.getElementById('url-form').onsubmit = e => {
        e.preventDefault();
        instance.UI.loadDocument(document.getElementById('url').value);
      };
    });
});

we updated the hosts file to contain entries for

127.0.0.1 foo.infra
127.0.0.1 dev.foo.infra

we then loaded “http://foo.infra:3000” it worked as expected. but, when we switched to “http://dev.foo.infra:3000”, the watermark did not dissapear.
please let me know if you are able to replicate the issue

Hello zhales,

We were able to check and see the requests on the key your colleague provided were coming from foo.infra but the key is registered to suvoda.infra. Please update the domain registered on your key to the correct one.

Hope this helps.

Best Regards,
Darian Chen

It is the same behavior: suvoda.infra works as expected, dev.suvoda.infra does not remove the watermark.

Thank you !

Hello,

We have modified the settings to include the subdomain and that removed the watermark. The issue remains open from our point of view, as we would like the watermark to disappear without having to set the subdomain in the registered domain settings. This is a temporary workaround.

Please use the details from above and see if you can reproduce it on your side.

Thank you !

Hello zhales,

Thank you for trying the previous suggested method. I believe the problem could be because you’re using a non-standard TLD (Top-level domain). Please try changing it to a standard one and make sure to set the domain of the key to the exact URL you are using.

Thank you.

Best Regards,
Darian Chen