- Home
- Forum
- JavaScript - EJ 2
- PDF export
PDF export
Some Arabic characters do not appear when exporting a file to PDF like ' ت , ا, ن , ل'
SIGN IN To post a reply.
3 Replies
1 reply marked as answer
MM
Manikandan Murugesan
Syncfusion Team
December 15, 2021 11:52 AM UTC
Hi Mosab,
You can export Non-English characters to PDF by using a custom font in the “beforeExport” event. Please refer the following code example.
Code Example:
|
function beforeExport(args) {
args.pdfExportProperties = {
theme: {
header: { font: new ej.pdfexport.PdfTrueTypeFont(base64_Alger, 10) },
caption: { font: new ej.pdfexport.PdfTrueTypeFont(base64_Alger, 10) },
record: { font: new ej.pdfexport.PdfTrueTypeFont(base64_Alger, 10) }
}
};
} |
Meanwhile, we have prepared a sample for your reference. Please find it from below link.
For more details about the “beforeExport” event, please refer the document link below.
Please let us know if you have any concerns.
Regards,
Manikandan
Marked as answer
correct solution. But apparently it only works with specific fonts, not all fonts
MM
Manikandan Murugesan
Syncfusion Team
December 16, 2021 02:03 PM UTC
Hi Mosab,
Pivot Table uses the Helvetica font in the export document by default (also have some standard fonts such as Times Roman, Helvetica, etc.,). For the exported document, you can use any custom font that supports Arabic symbol. Please follow the steps below.
- Download TTF file for the corresponding custom (which font support the - symbol) font (https://www.fontsquirrel.com/fonts/list/language/thai )
- Then convert the TTF file into base64 string (https://www.giftofspeed.com/base64-encoder/).
- Finally apply the base64 string to pdfTrupetypeFont.
If this is different from your requirement, then please let us know the more details with screen shot/video (if possible), so that we can work towards fulfilling your requirement.
Regards,
Manikandan
SIGN IN To post a reply.