pdf don't support RIT Arabic

pdf don't support RIT Arabic

ismael1999ismael1999 Posts: 6Questions: 2Answers: 0

how can I do it in this large files ?

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 61,887Questions: 1Answers: 10,140 Site admin

    Hi,

    There are a number of threads on this topic already if you search for them. Specifically have a look at this thread where I detail how this can be resolved (you need to create your own custom font for pdfmake).

    Allan

  • ismael1999ismael1999 Posts: 6Questions: 2Answers: 0

    Thank you for the quick reply. My project recognizes the Arabic language, but it is not from RTL. I searched and tried without results. Is there any advice for dealing with this huge file?

  • kthorngrenkthorngren Posts: 20,384Questions: 26Answers: 4,782

    See if this example from this thread helps.

    Kevin

  • ismael1999ismael1999 Posts: 6Questions: 2Answers: 0

    this example support Arabic ???

  • allanallan Posts: 61,887Questions: 1Answers: 10,140 Site admin

    It appears that the pdfmake library does not support RTL. Sorry - but that's where the issue would need to be resolved.

    Allan

  • marcobarsoummarcobarsoum Posts: 4Questions: 0Answers: 1
    Answer ✓

    it does,
    finally i found a solution
    1. choose arabic font with ttf true type.
    2. encode your font, using this page: https://www.giftofspeed.com/base64-encoder/
    3. download vfs_fonts.js : https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.53/vfs_fonts.js and open it.
    4. take your encoded font code, and replace it with each line of Roboto font code , in each line in vfs_fonts.JS (4 lines) , to change effect of font Roboto into your font characters..
    5. Embed pdfMake in your page :
    6. Embed vfs_fonts.js :
    7. generate pdf button :
    {extend: 'pdf', text: 'PDF', exportOptions: { orthogonal:"arabicPDF", columns: ':visible', }
    },
    8. use this code (to reverse arabic words from right to left) :
    columnDefs: [
    {
    targets: [0,1,2,3,4],
    render: function (data, type, row) {
    if (type === "arabicPDF") {
    data = extractContent(data);
    return data.split(' ').reverse().join(' ');
    }
    return data;
    }
    }],

    GOOD LUCK For All :smile:

Sign In or Register to comment.