question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

In pdf viewer, an error occurs when zooming

See original GitHub issue

Hello!

In pdf viewer, an error occurs when zooming.

Configuration:

  • Web browser: Chrome, Firefox, IE, Edge
  • Operating system: Win 10
  • PDF.js version: 1.7.343

Steps to reproduce:

  1. open the document
  2. zoom in/out
  3. wait a couple of minutes
  4. zoom in/out

Error in console:

Uncaught TypeError: Cannot read property 'rotation' of undefined
    at PDFPageView_transform [as cssTransform] (VM9875 pdf.viewer.js:16517)
    at PDFPageView_update [as update] (VM9875 pdf.viewer.js:16481)
    at PDFViewer.pdfViewer_setScaleUpdatePages [as _setScaleUpdatePages] (VM14856 pdf.viewer.js:18718)
    at PDFViewer_setScale [as _setScale] (VM14856 pdf.viewer.js:18743)
    at PDFViewer.set currentScaleValue [as currentScaleValue] (VM14856 pdf.viewer.js:18517)
    at Object.pdfViewZoomIn [as zoomIn] (VM9875 pdf.viewer.js:12173)
    at webViewerWheel (VM9875 pdf.viewer.js:13277)

This happens in the cssTransform function https://github.com/mozilla/pdf.js/blob/master/web/pdf_page_view.js#L281-L282

this.paintedViewportMap.get (target) is ‘undefined’, since this.paintedViewportMap.delete(this.canvas) is called after a few minutes.

The error appeared after the pull request https://github.com/mozilla/pdf.js/pull/7977/files

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:5

github_iconTop GitHub Comments

1reaction
Akabancommented, Mar 29, 2021

Hello !

Same here, if I zoom in I don’t have the error but while zooming out I get it.

React 16 here

If someone knows something would be greatly appreciated !

1reaction
ilnur-slvcommented, Mar 30, 2017

@Snuffleupagus Works well!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Facing problem with PDF Viewer Zoom beyond the 100%
It is properly loading with merge fields with Zoom 100%. Once we increase the Zoom more than 100%, page content is freezing while...
Read more >
Zoom Setting for PDF Viewer in Edge - Microsoft Community
I believe Edge is just opening it to whatever zoom the PDF document was saved with.
Read more >
Zoom-in PDF Viewer - Feature requests - Paperpile Forum
Hi,. This error was indicated time back. When pinch-zooming, the zoom-in also magnifies the topbar and the result is a pixelated document.
Read more >
Error when opening PDF file in app after adding zoom plugin ...
App is crashing when opening a pdf after downoading inside a temporary folder. To open the pdf I am using cordova-plugin-document-viewer ...
Read more >
Error: Insufficient data for an image in Acrobat or Acrobat Reader
Solution · Change the zoom settings so you can see the contents of the document. Try reducing the Zoom factor, or click Fit...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found