intbot / ng2-pdfjs-viewer

An angular component for PDFJS and ViewerJS (Supports all versions of angular)
Apache License 2.0
228 stars 113 forks source link

Canvas mouse events #153

Closed tigrenok00 closed 2 years ago

tigrenok00 commented 3 years ago

Hi,

I'm trying to capture mouse events on a page canvas, but this doesn't seem to get triggered. When I used PDF.js directly this was working, but using this plugin it does not. Any idea how to achieve it? I also tried to not set the cursor to hand, and tried disabling text and annotation layers (which did not work - I saw another issue opened about it), but it didn't help.

    (
      this.pdfViewer.PDFViewerApplication.pdfViewer._pages[0]
        .canvas as HTMLElement
    ).onmousedown = (e) => {
      console.log('onmousedown');
      console.log(e);
    };
codehippie1 commented 3 years ago

@tigrenok00 Though the library exposes underlying pdfjs object - The requested issue is beyond the capabilities and vision of this wrapper. I have plans to upgrade the underlying pdfjs to latest stable version. You may check it then. Till then look for solutions via stackoverflow with this library as tag.

CristianPumaES6 commented 3 years ago

Hi,

I'm trying to capture mouse events on a page canvas, but this doesn't seem to get triggered. When I used PDF.js directly this was working, but using this plugin it does not. Any idea how to achieve it? I also tried to not set the cursor to hand, and tried disabling text and annotation layers (which did not work - I saw another issue opened about it), but it didn't help.

    (
      this.pdfViewer.PDFViewerApplication.pdfViewer._pages[0]
        .canvas as HTMLElement
    ).onmousedown = (e) => {
      console.log('onmousedown');
      console.log(e);
    };

Hola, tuve un requerimiento en el cual querían ver la información de cada punto del chart. lo que hice fue solo, activar todos los tooltip antes de tomar captura al elemento canvas. Fue todo un dolor de cabeza.

Te mando una captura para que veas como quedo haber si te da una idea.

Saludos y suerte!

image

codehippie1 commented 2 years ago

@CristianPumaES6 The library is to display PDF, I am unsure if I can help with specific requirements your clients have. Ask a question on SO with ng2-pdfjs-viewer as tag

scry-UrjitDesai commented 1 year ago

Any updates on this? Can we have mouse events on the underlying canvas? I was not able to find anything on stackoverflow regarding the same. @codehippie1