Using the library on local

Hello, I’m using PDF.js Express Viewer UI version 8.7.0, Core version 8.7.4, webviewer.min.js 8.7.4.

I’m using it as a local file because I don’t have a webserver on the device and I created a free license key, but I always see the PDF.js Express logo on PDFs. It happens on every document.

This is the code of how I initialize the library:

WebViewer({
    path: 'lib', // path to the PDF.js Express'lib' folder on your server
    licenseKey: 'XXXX',
    initialDoc : pdfUrl,
    disabledElements : [
        'viewControlsButton',
        'viewControlsOverlay',
        'panToolButton',
        'fitButton',
        'selectToolButton',
        'toolsButton',
        'searchButton',
        'leftPanelButton',
        'freeHandToolGroupButton',
        'highlightToolButton',
        'highlightToolButton2',
        'highlightToolButton3',
        'highlightToolButton4',
        'underlineToolButton',
        'squigglyToolButton',
        'strikeoutToolButton',
        'textToolGroupButton',
        'shapeToolGroupButton',
        'rectangleToolButton',
        'ellipseToolButton',
        'lineToolButton',
        'arrowToolButton',
        'polylineToolButton',
        'polygonToolButton',
        'cloudToolButton',
        'eraserToolButton',
        'signatureToolGroupButton',
        'freeTextToolButton',
        'stickyToolButton',
        'miscToolGroupButton',
        'calloutToolButton',
        'stampToolGroupButton',
        'rubberStampToolGroupButton',
        'fileAttachmentToolGroupButton',
        'cropToolButton',
        'toolsButton',
        'searchButton',
        'menuButton',
    ]
}

I would like to remove the PDF.js Express logo on the documents.
Can anyone help me? Thank you!

Hi there,

Are you viewing your project on localhost? The watermark will still display on localhost even with a license key.

Best Regards,
Darian

Hi Darian,
thank you very much for your help!

Yes, the watermark remains visible to me always in localhost. However, I wonder if it’s possible to remove it in this case.
Perhaps I haven’t understood correctly, but when I create a new license key, it says this:

Please enter the root domain you wish to use this license on (your key works on a root domain name and any of its subdomains, as well as localhost)

Doesn’t this mean that the license key is also valid for localhost and therefore the watermark should not be displayed? Is it possible to remove it? My project works in localhost, and I cannot change this.

Thank you very much!

Best Regards,
Ruggero

Hi there,

The license key will work on localhost, but it will always show a watermark.

Please see the following answers below:

Are you having any issues with removing the watermark on your domain?

Best Regards,
Darian

Hi Darian,
our problem is that we need to make the library work on devices that have proprietary OS that only allow us to load the web page from a local file (which is equivalent to a localhost but is not a traditional web server that we have access to).

I have no choice, but I need to remove the watermark. How can I do this in this case? We only need to display the document without any further operations.

Thank you very much for your support!
Best Regards,
Ruggero

Hi there,

Unfortunately, we cannot remove the watermark from localhost even if it is just to display the document.
Here is a Stack Overflow post that might help with this. It talks about running a web server with a name other than localhost: asp.net - How to configure web server to run with another name instead of 'localhost' - Stack Overflow

Best Regards,
Darian