Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Text layer does not match PDF page original rotation #1742

Open
vicent4no opened this issue Mar 27, 2024 · 0 comments
Open

Text layer does not match PDF page original rotation #1742

vicent4no opened this issue Mar 27, 2024 · 0 comments

Comments

@vicent4no
Copy link

Data

Test file:
https://www.dropbox.com/scl/fi/m1pwflz7ufnuop692qzvn/stevenazzi-maquinas-termicas-Copy_compressed-transformed.pdf?rlkey=3kb9di6buwqj8nbj35igulcex&dl=0

Description

In PDF viewers, and in PDFJS viewer, the text layer has the correct orientation.

In react-pdf-viewer, the text layer is unrotated. As a consequence, the image is rotated but the text layer isn't, which causes a shift in text position and direction.

See example:

  1. PDFJS viewer:
    image

  2. react-pdf-viewer:
    image

Possible related issues and solution

The following PDFjs issue explains that for viewers that use PDFjs it is needed to actually rotate the text layer before rendering it. The issue owner actually adds a code snippet with the solution.

I think that this is the case, since in react-pdf-viewer TextLayer's implementation there is no text layer container rotation depending on the current page rotation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant