Skip to content

[Bug]: Annotations rotate on horizontal PDFs #20153

@Evickerest

Description

@Evickerest

Attach (recommended) or Link to PDF file

rotated.pdf

Web browser and its version

Chrome Version 138.0.7204.184

Operating system and its version

Windows 11 Pro version 23H2

PDF.js version

5.4.54

Is the bug present in the latest PDF.js version?

Yes

Is a browser extension

No

Steps to reproduce the problem

  1. Create a pdf that has its pages rotated 90 degrees. I used the qpdf command "qpdf input.pdf --rotate=+90:1-z output.pdf" to do so.
  2. Open the pdf in the viewer, add a highlight annotation anywhere.
  3. Save and download the pdf, and reopen it.
  4. Clicking and unclicking the highlight button cause the highlight annotation to rotate 90 degrees.

What is the expected behavior?

The expected behavior is that the annotation doesn't move when clicking the highlight button:

Image

What went wrong?

Clicking the highlight button causes the highlight annotation to rotate. However, this a purely a visual change, and saving and downloading the pdf shows the right location of the annotation

Image.

Link to a viewer

No response

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions