stephanrauh / ngx-extended-pdf-viewer

A full-blown PDF viewer for Angular 16, 17, and beyond
https://pdfviewer.net
Apache License 2.0
487 stars 184 forks source link

No 'annotationEditorEvent' when adding a text with 'HighlightEditor' #2556

Closed afnan-davia closed 2 months ago

afnan-davia commented 2 months ago

Bug description In Angular, when I add highlight annotations on text (or even without it being on text), no event is fired. However, if I delete (with the context menu button or with DEL button) the annotation, a 'removed' event is fired without no issue.

Reproduction

  1. Use an editor with "annotationEditorEvent". For example:
    <ngx-extended-pdf-viewer [src]="'https://pdfobject.com/pdf/sample.pdf'"  [textLayer]="true (annotationEditorEvent)="onAnnotationEditorEvent($event)">

    In the Angular component:

    onAnnotationEditorEvent(event: any): void {
       console.log('Event annotationEditorEvent: ', event);
    }
  2. Add a highlight on any text: no event is fired

Version info

Demo PDF file sample.pdf

stephanrauh commented 2 months ago

Version 20.4.1 is going to add the event.

Enjoy! Stephan