Skip to content

jsPDF Unicode Languages Support  #2093

@VahidFarahmandian

Description

@VahidFarahmandian

I have problem using Unicode characters. I have tested using basic.html but still no success.
I have read the issues related to this problem too but still no success.

Here is what I have done based on the examples/basic.html:

    var BNAZANIN = "AAEAAAAQAQAA....";//shortened. Font is encoded using fontconverter/fontconverter.html 
    var doc = new jsPDF();
    doc.addFileToVFS("BNAZANIN-normal.ttf", BNAZANIN);
    doc.addFont('BNAZANIN-normal.ttf', 'BNAZANIN-normal', 'normal');
    doc.setFont('BNAZANIN-normal'); // set font
    doc.text("سلام hello", 10, 10);
    doc.save('test.pdf');

as you see we need to see "سلام hello" in the output, but the generated output is as below:

capture

If I use doc.text("hello", 10, 10); still the output is same! Below is the code based on basic.html:

image

Is there any thing wrong with my code?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions