Watermark issue

Which product are you using?
PDF.js Express Viewer

PDF.js Express Version
|UI version|‘8.3.2’|
|Core version|‘8.3.0’|
|Build|‘My8xNi8yMDIyfDJiMGM2Y2IyZA==’|
|WebViewer Server|false|
|Full API|false|

Detailed description of issue
Even though I entered the PdfJs.Express license key, the watermark in the docs still remains. What do I have to do to get the Watermaks remove?

Expected behaviour
{Provide a screenshot or description of the expected behaviour}

Does your issue happen with every document, or just one?
Every document.

Link to document
{Provide a link to the document in question if possible}

Code snippet

var currentPage = 0;
WebViewer({
path: “/Scripts/viewer/”,
initialDoc: “@ViewBag.PdfFileUrl”,
licenseKey: “mgyOU8FJzV1fx6x8CRWp”,
}, document.getElementById(‘viewer’))
.then(instance => {
const { Core, UI, docViewer } = instance;
const { Tools, documentViewer} = Core;
const panTool = Tools.ToolNames.PAN;

        UI.setToolMode(panTool);
        UI.disableElements(["AnnotationCreateSticky", "AnnotationCreateFreeText", "leftPanel", "leftPanelButton", "toolbarGroup-Edit", "toolbarGroup-View", "toolbarGroup-Annotate", "toolbarGroup-Shapes", "toolbarGroup-Insert", "toolbarGroup-FillAndSign", "toggleNotesButton", "themeChangeButton", "searchButton", "viewControlsButton", "moreButton", "printButton", "menuButton", "toolsHeader"]);
        //instance.UI.enableElements(["menuButton"]);
        UI.setHeaderItems((header) => {
            header.getHeader('default').push({
                img: "icon-header-download",
                index: -1,
                type: "actionButton",
                element: 'downloadButton',
                onClick: () => {
                    instance.UI.downloadPdf()
                }
            });
            header.getHeader('default').push({
                img: "icon-header-print-line",
                index: -1,
                type: "actionButton",
                element: 'printButton',
                onClick: () => {
                    instance.UI.print()
                }
            });
        });

        UI.setLanguage("@(string.IsNullOrEmpty(Request.QueryString["language"]) || string.IsNullOrEmpty(Request.QueryString["language"]) ? "tr" : Request.QueryString["language"])");
        UI.setTheme("@(ViewBag.Theme)");

        documentViewer.addEventListener('pageNumberUpdated', (pageNumber) => {
            currentPage = pageNumber;
            const totalPage = docViewer.getPageCount();
            var element = document.getElementById("approve");

            if (currentPage == totalPage) {
                element.removeAttribute("disabled");
                element.classList.remove("disabled");
            } else {
                element.setAttribute("disabled", "disabled");
                element.classList.add("disabled");
            }
        });
    });
</script>

Hello, I’m Ron, an automated tech support bot :robot:

While you wait for one of our customer support representatives to get back to you, please check out some of these documentation pages:

Guides:APIs:Forums:

Hey there,

This is a bit hard to investigate without additional information.

Where are you loading the viewer? PDF.js Express will always have a watermark on localhost domains, even when a key is provided.

Are you loading the viewer on the domain you specified when creating the key?

Thanks,
Logan

Hi Logan;

Yes, we are loading the viewer on the domain we specified creating the key?

The sample link is below, you can check it yourself.
https://dmobil.stablex.net:8083/B306D0FC-E6F6-4C6F-BB77-71C9861566C7?language=en

Where am I making a mistake? I would be glad if you help.

Hi there,

You are using the wrong NPM package.

You should be using @pdftron/pdfjs-express-viewer and not @pdftron/pdfjs-express

Thanks,
Logan

Thanks for help Logan, my problem was solved.

Have a good day.

1 Like