Highlights and annotations move on pdf while zoom in and zoom out

PDF.js Express Version


Detailed description of issue
On zooming in or zooming out on the pdf using Ctrl + and ctrl - , the highlights or annotations on the pdf get shifted. Is there a way to prevent that from happening?

Expected behaviour
The highlights / annotations should stick to their place while zooming in/out .

Does your issue happen with every document, or just one?
Every document

Link to document
{Provide a link to the document in question if possible}

Code snippet
{Provide a relevant code snippet}

I cannot reproduce your issue.

Can you please record a GIF of this happening? Can you also please provide your PDF.js Express version as the template asks for.


I am also getting this issue. I noticed it happens when zooming in and out very quickly and can be fixed by zooming in/out again.

For example zoom in/out very quick, they get moved to the wrong spot. Press the zoom in/out button once after that and they return to the appropriate spot.

Hey Logan,

I have updated the version in the above template. Also , PFA gif for this behaviour . This is happening on all pdfs so its quite critical for us to know the reason behind the displacement of the highlights.

Let me know your thoughts on it.
higlight-gif.zip (625.2 KB)

Hey guys,

This is actually an issue with some of our rendering code and not the highlights themselves. You’ll notice the entire page is getting rendered at the wrong size.

I have added this as a high priority item to our bug list. However, our rendering code is pretty complex and this might take a little while to fix.

I will keep you updated on our progress on this one.

Thank you!

Hi Logan!
Is there any update on this bug? Has this been addressed in the version 8 release? Any fix for this would be really helpful.
Hoping to hear back from your team soon.

Thank you

Hi there,

What crazy timing - we actually just fixed this bug a couple days ago and I was going to push a release today. Look for version 8.1.0 today! I will post an announcement in #announcements


Hey there,

Just pushed 8.1.0 which will fix the incorrect page rendering issue.

Thank you!