Other languages in pdfmake
Is it possible to add other language support other than English (UTF-8) in pdfmake library? something like,
var dd = {
content: [
'ಕನ್ನಡ', //Kannada
'മലയാളം' //Malayalam
]
}
any news regarding this?
I do not know these languages, but: LTR languages are supported (is need a font file that supports this language) RTL languages are not supported - pending issue https://github.com/bpampuch/pdfmake/issues/184
Can you give me an example of how to accept for example English an another one? Thanks!!!
Manual of how to use custom font: https://github.com/bpampuch/pdfmake/wiki/Custom-Fonts---client-side
Its working for few fonts but Lohith-kannada.ttf font not working and gives blank spaces. Also baraha-kannada.ttf font gives jumbled words.
Myself asked a question in Stack overflow here.
@liborm85 , Myself tried with BARAHAKN.TTF, Nudi_05_k.ttf and lohit_kn.ttf Kannada fonts but each fonts giving jumbled sentences. Any workarounds to solve the issue?
Kannada currently not supported (see test report). Implementation is required to fontkit library, which pdfmake uses.
@liborm85 Find the referenced issue above.
@mpsbhat That's good. As soon as the new version of fontkit, it will work in pdfmake also.
@liborm85 , can we test it before release of new version of fontkit? Myself searching within the pdfmake files but didn't found the fontkit library call.
@mpsbhat pdfmake calls only the pdfkit library. Calling the fontkit library is up to pdfkit library. Sorry, I don't know how to build fontkit from source code... :(
Ok @liborm85 Thank you for the info.
Finally succeeded build :)
pdfmake + fontkit-dev with kannada/indic support: pdfmake.zip
I don't know if it is correct build, but it looks like it works. :) I try it with this font: https://github.com/devongovett/fontkit/blob/indic/test/data/NotoSans/NotoSansKannada-Regular.ttf
The above build gives blank pdf :(
We included above pdfmake.js and created a new vfs-fonts.js using the mentioned font.
The base64data as follows:
blob:null/096f394c-61cb-42d6-a3c1-58f9545286d5
Here is my full test script: pdfmake-indic-test.zip This works for me, Try it.
Splendid...!!!

Thanks @liborm85 :)
How can we use both English & Kannada fonts simultaneously?
You create vfs_fonts.js file with multiple fonts. One for English and other for Kannada. See https://github.com/bpampuch/pdfmake/wiki/Custom-Fonts---client-side
fontkit 1.7 has full support for indic scripts, including Kannada and 9 others. See https://github.com/devongovett/fontkit/pull/99 for details.
New version pdfmake released.