Skip to content

Reverse the text in the HTML element while using html method  #3094

Open
@nivb52

Description

@nivb52

Using the html method with HTML element RTL text will result in reversed text for example:
אב -> בא
This can be solved with function before cloning the element or option on the method.

At the moment i solved it with regex + string.replace method,
but that can become an issue in large text.

Activity

changed the title [-][feature] Reverse the text in the HTML element while using html method [/-] [+]Reverse the text in the HTML element while using html method [/+] on Feb 16, 2021
HackbrettXXX

HackbrettXXX commented on Feb 17, 2021

@HackbrettXXX
Collaborator

Thanks for the report. Could you check, if this is an issue of html2canvas? To do this, render your HTML markup with html2canvas into an HTML canvas.

nivb52

nivb52 commented on Feb 19, 2021

@nivb52
Author

I did check html2canvas, it was printed properly. (i didn't use there package because the resolution was trouble and playing with the numbers was like a guessing game).

HackbrettXXX

HackbrettXXX commented on Feb 19, 2021

@HackbrettXXX
Collaborator

Thanks for checking. Then this is a bug in jsPDF. Could you investigate what's causing it any maybe prepare a pull request?

nivb52

nivb52 commented on Feb 19, 2021

@nivb52
Author

okay, I will keep you posted.

ronbiter

ronbiter commented on May 24, 2021

@ronbiter

hey, anything new on this issue? could really use the rtl support for mixed content (I have content written in hebrew + english + numbers) and in the pdf its not printed correctly.
tried to use setR2L(true) , it fixed the hebrew but revesed the numbers and the enlish content

nivb52

nivb52 commented on May 30, 2021

@nivb52
Author

Sorry, I didn't got to it yet. In the meantime, if it is a short document (less than 10- 20 pages) and you don't have Hebrew and English in the same word you can flip the Hebrew words with simple split,reverse, join.

HackbrettXXX

HackbrettXXX commented on Sep 14, 2021

@HackbrettXXX
Collaborator

Related to #3171.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @ronbiter@HackbrettXXX@nivb52

        Issue actions

          Reverse the text in the HTML element while using html method · Issue #3094 · parallax/jsPDF