When I export datatable to pdf in Arabic language pdf file appear wrong language cant read and under

When I export datatable to pdf in Arabic language pdf file appear wrong language cant read and under

mohmd42597mohmd42597 Posts: 17Questions: 4Answers: 0

Link to test case:
Debugger code (debug.datatables.net):
Error messages shown:
Description of problem:

Answers

  • colincolin Posts: 11,798Questions: 0Answers: 1,999

    This thread should help, it's asking the same thing.

    Cheers,

    Colin

  • mohmd42597mohmd42597 Posts: 17Questions: 4Answers: 0
    edited May 18

    thanks for reply @colin
    i have same problem
    i use this code:-
    i work with visual studio 2017.


    pdfMake.fonts = { Arial: { normal: 'arial.ttf', bold: 'arialbd.ttf', italics: 'ariali.ttf', bolditalics: 'arialbi.ttf' }, }; // and $('#mytable').dataTable({ "bDestroy": true, "lengthMenu": [[10, 25, 50, 75, -1], [10, 25, 50, 75, "All"]], order: [[0, 'asc']], paging: true, searching: true, "dom": 'Blfrtip', "buttons": [ { extend: 'pdf', text: 'Export PDF', exportOptions: { columns: ':visible' }, customize: function (doc) { doc.defaultStyle.font = 'Arial'; } )}

    // this give my this error
    No unicode cmap for font
    at t.registerTTF (pdfmake.min.js:14)
    at new t (pdfmake.min.js:14)
    at r.font (pdfmake.min.js:13)
    at r.getFont (pdfmake.min.js:10)
    at r.widthOfString (pdfmake.min.js:10)
    at pdfmake.min.js:12
    at Array.forEach (<anonymous>)
    at u (pdfmake.min.js:12)
    at r.buildInlines (pdfmake.min.js:12)
    at r.measureLeaf (pdfmake.min.js:10)

  • colincolin Posts: 11,798Questions: 0Answers: 1,999

    That error is also in this thread. The issue was raised with PDFmake, and they suggested updating, so would be worth trying that. If no joy, maybe reply back to the PDFmake thread.

    Colin

  • mohmd42597mohmd42597 Posts: 17Questions: 4Answers: 0

    Sir :/ @colin thanks for reply
    i review this thread but no one give any solution
    i use this for Arabic language can you help me for any library in datatable to solve this issue

  • colincolin Posts: 11,798Questions: 0Answers: 1,999

    There are a few threads discussing that, try this one here.

    Colin

Sign In or Register to comment.