ngx-extended-pdf-viewer: Fast zooming crashes the viewer on Android / Chrome

Describe the bug Slowly pinch zooming works with enablePinchOnMobile in Chrome / Webviews on Android. Fast zooming in and scrolling leads to glitching, flickering and eventually crashes the whole web view (ionic capacitor app / chrome tab). See the video for examples.

Version info

  • Version of ngx-extended-pdf-viewer: ^8.1.2

Smartphone (please complete the following information):

  • Device: One Plus 5
  • OS: Android 10
  • Browser: Google Chrome 88.0.4324.181

To Reproduce Navigate to https://pdfviewer.net/touch-gestures. Zoom in fast on the PDF and then try to scroll.

Demo PDF file The default PDF on https://pdfviewer.net/touch-gestures works.

Screenshots See this videos. One time in an Ionic App (in a web view) and two times in the Google Chrome App. First I tested slow zooming & scrolling which works. Fast zooming breaks everything. The chrome tab has to be closed entirely.

https://user-images.githubusercontent.com/10384363/109139329-afcb5600-775b-11eb-995d-9f451924a4a5.mp4

https://user-images.githubusercontent.com/10384363/109139340-b35edd00-775b-11eb-80f6-cf022a99aa06.mp4

https://user-images.githubusercontent.com/10384363/109139351-b5c13700-775b-11eb-870b-b34f250c0e82.mp4

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 17 (10 by maintainers)

Most upvoted comments

Thank for providing the additional info! Unfortunately, I still don’t have an Android device, so I can’t reproduce the bug. Is it possible to reproduce the bug in a desktop Chrome or an iOS device?

Thanks for the tips @stephanrauh!

I just tested a bit and the problematic code seems to be setting the pdf.js scaling factor currentScale in touchend with high values. The CSS-transform scaling itself works without any problems. Just the pdf.js-scaling in touchend sometimes triggers to the bug. Because the mobile Chrome App completely freezes or crashes I could not debug any further with Chrome Remote Debugging tools.

So in the end the bug is in pdf.js itself and not this library… useOnlyCssZoom seems to help though.

If you don’t mind, I’m going to document the problem and the workaround on the troubleshooting page and close the ticket. I’d prefer to solve the problem, but as long as I can’t even reproduce it, I won’t be able to solve it.