You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
PDFJS viewer:
react-pdf-viewer:
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.
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:
PDFJS viewer:
react-pdf-viewer:
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.
The text was updated successfully, but these errors were encountered: