How to support UTF-8 character in PDF and CSV export ?

How to support UTF-8 character in PDF and CSV export ?

lovertech496lovertech496 Posts: 18Questions: 4Answers: 0

I come across the following beautiful data table

https://codepen.io/oliuz/pen/mYObzg
https://forum.vuejs.org/t/how-to-make-a-html-table-filter-and-export-to-pdf-csv-xls-with-a-json-format-file/89462

It is not supported Utf-8 character i.e other languages in PDF and CSV and other formats supports.

Can you please help me how to fix it? 

This question has an accepted answers - jump to answer

Answers

  • rf1234rf1234 Posts: 2,806Questions: 85Answers: 406

    It is not supported Utf-8 character i.e other languages in PDF and CSV and other formats supports.

    What makes you say they are not supported? I am also using it with special characters and have no issues. Can you provide a test case please.

  • lovertech496lovertech496 Posts: 18Questions: 4Answers: 0

    Attached the sample html file.

  • colincolin Posts: 15,142Questions: 1Answers: 2,586

    The file didn't attach, but we need a running test case rather than just the code. A test case that replicates the issue will ensure you'll get a quick and accurate response. Information on how to create a test case (if you aren't able to link to the page you are working on) is available here.

    Cheers,

    Colin

  • lovertech496lovertech496 Posts: 18Questions: 4Answers: 0
    edited October 2022

    Colin, does it supports utf-8 characters.
    Attached the font where the characters are not exported. Please let me know the simple configuration to give a try

    datatables.net/forums/uploads/editor/pt/38cj1yj5026m.zip

    அந்த அடையாளத்தை இடு
    பரிமாணங்கள்
    ஒரு மனிதன்

  • rf1234rf1234 Posts: 2,806Questions: 85Answers: 406

    I copied this stuff into a Data Table and did the Excel export. No issues at all!

    Again: Please post a test case showing your issue!

    Here is a screenshot from my Excel.

    Screenshot of Editor entry:

    Screenshot of Data Table entry:

  • lovertech496lovertech496 Posts: 18Questions: 4Answers: 0

    PDF export is NOT working

  • lovertech496lovertech496 Posts: 18Questions: 4Answers: 0

    Any answer from anyone on PDF export

  • kthorngrenkthorngren Posts: 20,269Questions: 26Answers: 4,765

    I believe this thread provides the answer to your question.

    Kevin

  • lovertech496lovertech496 Posts: 18Questions: 4Answers: 0

    No, Kevin it was quite confusing. Can you please help me with a small HTML file with one record with the above characters for PDF export. I was been struggling for days.

    Please help if possible with one record.

  • kthorngrenkthorngren Posts: 20,269Questions: 26Answers: 4,765
    Answer ✓

    I've not done this myself but this SO thread seems to have detailed steps of creating your own PDFMake font file.

    Kevin

  • lovertech496lovertech496 Posts: 18Questions: 4Answers: 0

    Thank you and got solved

    What is the fix?

    1. Downloaded the latest pdfmake and vfs_font.js
    2. Added the fonts in vfts_font including arial and other fonts
    3. Used the code shown in the SO thread
    4. Working Great
  • kthorngrenkthorngren Posts: 20,269Questions: 26Answers: 4,765

    Fantastic! Glad its working and thanks for posting your steps.

    Kevin

Sign In or Register to comment.