Bug 464980 - Annotations in rotated PDF not rotated
Summary: Annotations in rotated PDF not rotated
Status: REPORTED
Alias: None
Product: okular
Classification: Applications
Component: PDF backend (show other bugs)
Version: 22.12.1
Platform: Arch Linux Linux
: NOR normal
Target Milestone: ---
Assignee: Okular developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-01-29 13:00 UTC by quintus
Modified: 2024-07-02 23:37 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description quintus 2023-01-29 13:00:36 UTC
SUMMARY
Adding an annotation to a rotated PDF results in an unrotated annotation.

STEPS TO REPRODUCE
1. Rotate a PDF using the View menu
2. Create a text annotation with any content (ALT+5)
3. Witness how the annotation is not in the direction of the view, but of the original PDF.

OBSERVED RESULT

The annotation is not rotated, that is, it aligns with the original PDF orientation rather than that of the view.

EXPECTED RESULT

It should be rotated according to the view.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: ArchLinux kernel 6.1.8-arch1-1
KDE Plasma Version: 5.26.5
KDE Frameworks Version: 5.102.0
Qt Version: 5.15.8

ADDITIONAL INFORMATION

I correct exams, send in by students, using Okular's annotation facility (with red color, in case this is important). The students are required by the university to scan them to PDF with whatever means they have at hand. More often than not, this is their smartphone. As a result, the documents are often not upright. So I rotate them using Okular's rotation features to view them upright. When I then use the annotation facility (ALT+5) to add my corrector's comments to the page, those comments are not placed where I click, but set off, and they are rotated incorrectly, namely into the direction of the original PDF file, whereas they should be rotated so they align with the view.
Comment 1 Albert Astals Cid 2023-02-04 14:46:43 UTC
> 1. Rotate a PDF using the View menu

This does not rotate a PDF at all, just rotates your view of the file contents.

That's why I don't think this is a bug.
Comment 2 quintus 2023-02-05 18:53:23 UTC
> That's why I don't think this is a bug.

I beg to differ. If the typewriter functionality is provided for a view-rotated PDF, then it should honour such rotation. If using the typewriter tool on a view-rotated PDF is not expected to create a properly rotated annotation, then what else it is supposed to do on a view-rotated PDF? The current state does not allow any useful operation with the typewriter tool on a view-rotated PDF.  Thus, I think that the bug is either in allowing the typewriter tool at all for a rotated view, or in creating an unexpected outcome when using it on a view-rotated PDF. I would vouch for the second interpretation because that is more useful from a user's point of view; I provided a usecase in the OP.

That being said, the resolution for the other interpretation is to forbid use of the typewriter tool on a view-rotated PDF. In that case, I would refile this ticket a feature request.
Comment 3 Samuele 2024-07-02 23:37:38 UTC
Just found this bug. I too am trying to add a text note on the PDF; in the current state this is impossible both if I rotate it and if I don't rotate it, as in the latter case I still would have the text with the wrong direction.
The only workaround to actually use this tool seems to rotate the PDF with another program, but this creates a very bug confusion about the View > Orientation > Rotate option: I would expect this to let me use any tool while in the rotated state, while it seems that he who does not think this is a bug is asking us to refer to this option as something abstract which the users must account for; to me instead is a disconnection between the intention and the effect.
Maybe Okular should be able to actually rotate the PDF (instead of just displaying it rotated), or at least to use all its tools in an intuitive way.