-
-
Notifications
You must be signed in to change notification settings - Fork 885
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
PDF renders incorrectly if wrapped in an element with dir="rtl" #588
Comments
I had the same issue, the problem was in global styles - font color replacement |
i have the same issue, @malachitetrip removing global styles didnt help. |
Could not reproduce when uploading this to my test suite, neither on Firefox nor Chrome. With what browser and React-PDF version are you able to reproduce that with? |
im using '5.0.0-beta.4' version (in order to avoid a different issue), and it happens in all browsers.
|
Doesn't seem to be the case... I tried reproducing this error, both on 4.1.0 stable and 5.0.0-beta.4 Dummy PDF file displays absolutely fine on Chrome and Firefox. https://codesandbox.io/s/react-pdf-dummy-pdf-9q27q Does anyone see the above link with PDF wrongly rendered? If so, please share your setup with me so I could reproduce and see where the issue is. |
ok found it, seems like <body dir="rtl" is causing the funky render. you can see the problem here: |
👏 👏 👏 Amazing job! "dir" can actually be set on per-element level, so it would be as easy as wrapping the document in Seems like this needs to be fixed on PDF.js end, though. I'll report it. |
Note: This fix was cherry-picked to v4.2.0 release. |
So I'm using this module in a fairly simple way as follows (my build is standard react-create-app):
The PDF renders the text very weirdly like that:
I'm using the simple dummy pdf from: https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf
I can't figure out what's the problem. My base64 is ok and I doubled checked it online to see it renders correctly. No matter which PDF I try, I always get this.
I don't have any errors on my console, other than this warning:
The text was updated successfully, but these errors were encountered: