How to add custom cursor (using a png)

I want to add a custom cursor on click of text highlight tool. The cursor icon is ‘border_color’. How can I achieve it? Is it possible to use a png and make it work?

1 Like

Thank you for posting your question to our forum. We will provide you with an update as soon as possible.

1 Like

Anyone has idea about this please?
Making custom cursor using a PNG image.
And I want this custom cursor to appear on click of a particular tool.

1 Like

Hi Ashwin,

You can use the Tool.switchIn method to enable your custom cursor for whichever tool you need it for.

To set the cursor apply the CSS property cursor to the viewer element
Ex:

    const { Core } = instance;
    const { documentViewer, Tools } = Core;
    const originalSwitchIn = Tools.EraserTool.prototype.switchIn
    Tools.EraserTool.prototype.switchIn = function() {
      originalSwitchIn.apply(this, arguments);
      documentViewer.getViewerElement().style.cursor = 'url("YOUR_URL_HERE"), default'
    }

Best Regards,
Ahmad Moaaz
Software Developer
Apryse

1 Like