persian language with datatables pdfmeke

persian language with datatables pdfmeke

saee2838saee2838 Posts: 18Questions: 6Answers: 0

hi
i want use persian language in datatables and use pdfmake

but it dosent work

can you help me
i want this soulation

this is my code

<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/v/bs/jszip-2.5.0/dt-1.10.20/b-1.6.1/b-colvis-1.6.1/b-flash-1.6.1/b-html5-1.6.1/b-print-1.6.1/datatables.min.css"/>



<script type="text/javascript" language="javascript" class="init">

pdfMake.fonts = {
Arial: {
normal: '../includes/fonts/BElham.ttf'
}
};

$(document).ready(function() {

$('#example').DataTable( {
    dom: 'Bfrtip',
    buttons: [
        {
            extend: 'pdfHtml5',
                "text": "<i class='fa fa-file-pdf-o bigger-110 red'></i> <span class='hidden'>Export to Pdf</span>",
                "filename": "Report Name",
                "className": "btn btn-white btn-primary btn-bold",
                "charset": "utf-8",
                "bom": "true",

                init: function(api, node, config) {
                    $(node).removeClass("btn-default");
                },
                customize: function (doc) {
                    doc.defaultStyle.fontSize = 20;
                    doc.defaultStyle.font = 'Arial';
                }
        }
    ]
} );

} );

</script>

{/literal}

Answers

  • colincolin Posts: 15,240Questions: 1Answers: 2,599

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

    Cheers,

    Colin

This discussion has been closed.