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

Putting canvas in a container with dir="rtl" messes up the rendering #12081

Closed
wojtekmaj opened this issue Jul 9, 2020 · 2 comments
Closed

Comments

@wojtekmaj
Copy link
Contributor

Attach (recommended) or Link to PDF file here:

dummy.pdf

Configuration:

  • Web browser and its version: Any
  • Operating system and its version: Any
  • PDF.js version: 2.4.456
  • Is a browser extension: No

Steps to reproduce the problem:

https://codesandbox.io/s/pdfjs-rtl-container-cwtt6

  1. Render canvas within a container with dir="rtl"
  2. 💥

It's easily fixed by adding canvas.setAttribute("dir", "ltr");, but I'm really not sure how this would affect RTL PDFs.

Original React-PDF bug for reference: wojtekmaj/react-pdf#588

What is the expected behavior? (add screenshot)

image

What went wrong? (add screenshot)

image

@Snuffleupagus
Copy link
Collaborator

Snuffleupagus commented Jul 9, 2020

Duplicate of #11457

It's easily fixed by adding canvas.setAttribute("dir", "ltr");

That's not a viable solution though, since the PDF.js library can be used in environments (such as Node.js) where that won't work; https://github.com/mozilla/pdf.js/tree/master/examples/node/pdf2png is one example.

Please note #11457 (comment)

@timvandermeij
Copy link
Contributor

Aside from the changes made in PR #11504 there doesn't appear to be anything else that we can do here unfortunately.

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

3 participants