How to display Hebrew text in pdf from my custom widget, using jsPDF library

459
1
Jump to solution
12-23-2020 12:32 AM
Labels (2)
MichaelLev
Occasional Contributor III

I'm developing custom widgets for WAB (Develper Edtion) 2.17, Launchpad Theme, on 3D Scenes (ArcGIS API for javascript 4.17), on our compamy portal (version 10.7.1).

I am still a newbie...

I need, from within javascript code of a custom widget, to create pdf file which will contain Hebrew text. I found jsPDF library, incorporated it by its jspdf.umd.min.js file and it creates pdf all right, but I have not succeeded to show Hebrew fonts.

jsPDF is good by the capability to show tables, so I wish to use it right. Maybe I have not set up all things as should be?

Does anyone have some sample code that can output Hebrew text (or Arabic, for example) to pdf, using jsPDF library?

Sample using other library like pdfmake will also help.

Help will be greatly appreciated,

Michael

1 Solution

Accepted Solutions
MichaelLev
Occasional Contributor III
At last I succeeded!
I used the fontconverter as recommended in jsPDF doc  to create js file that I activated and this has not worked for me, but using their 2nd way - downloading the binary ttf file that is also generated by that tool and using it as in thedropdown arabic example in jsPDF site, works well. Actually the ttf file coul be downloaded from other sites also.
I am very happy with jsPDF!

View solution in original post

1 Reply
MichaelLev
Occasional Contributor III
At last I succeeded!
I used the fontconverter as recommended in jsPDF doc  to create js file that I activated and this has not worked for me, but using their 2nd way - downloading the binary ttf file that is also generated by that tool and using it as in thedropdown arabic example in jsPDF site, works well. Actually the ttf file coul be downloaded from other sites also.
I am very happy with jsPDF!

View solution in original post