stephanrauh / ngx-extended-pdf-viewer

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

zoom event not fired when automatic zoom selected #125

Closed mcornillon87 closed 5 years ago

mcornillon87 commented 5 years ago

Check this first

Describe the bug (zoomChange)="zoomChanged($event)" zoomChanged fired when zoom is changed manually in the pdf viewer except when user select "Automatic zoom"

Capture d'écran 2019-08-18 11 39 21
stephanrauh commented 5 years ago

Interesting. And easy to fix. Oh, the pitfalls of the JavaScript language! :)

Remains the question what's a useful message. Truth to tell, page-fit, page-actual, and page-width set an example: just report that the zoom factor is auto.

I'd prefer to report the actual zoom factor in percent. However, I suspect that'd break backward compatibility. To avoid that, I could add a new event, something like (effectiveZoomFactor)or (currentZoomFactor).

Quelle est votre opinion, @mcornillon87 ?

stephanrauh commented 5 years ago

Of course I'm also interested in the opinion of everybody reading this. :)

stephanrauh commented 5 years ago

As it turns out, there's already a event of pdf.js notifying us about the real zoom factor: scalechanging.

So (effectiveZoomFactor) could be a simple mapper of scaleChanging.

mcornillon87 commented 5 years ago

Easy to fix is always good :) Yes a mapper of scaleChanging would be perfect then. As a french with an average english 🤔 (currentZoomFactor) sound more clear but (effectiveZoomFactor) is good too. A big thanks you for your job by the way, It is a revolution coming from ng2-pdf-viewer 👏

stephanrauh commented 5 years ago

@mcornillon87 Vous écrivez bien l'Anglaise. Au-dessus de la moyenne, j'imagine. :)

stephanrauh commented 5 years ago

Ah, you're referring to the component of Vadym Yatsyuk. He's written a nice component, but you're right, it's just the core PDF viewer. Adding the toolbar makes it so much more useful!

stephanrauh commented 5 years ago

It's a small change - but I guess the rules of semantic versioning make it a new minor version. So here it is: ngx-extended-pdf-viewer 1.1.0!