We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Turkish Characters Problem

Thread ID:

Created:

Updated:

Platform:

Replies:

147295 Sep 5,2019 11:50 AM UTC Sep 9,2019 12:12 PM UTC Angular - EJ 2 3
loading
Tags: Grid
kenan dogan
Asked On September 5, 2019 11:50 AM UTC

I use grid with export. https://ej2.syncfusion.com/angular/demos/#/material/grid/default-exporting

I cannot export because of Turkish characters.

What should I do?

Seeni Sakthi Kumar Seeni Raj [Syncfusion]
Replied On September 6, 2019 11:03 AM UTC

Hi Kenan, 

Greetings from the Syncfusion support, 

We could see you would like to use the Turkish font style for the Exporting Grid. This can be achieved by assigning the base64 string for Turkish font style to PdfTrueTypeFont property which can be assigned later to the Exporting theme of the Pdf export Properties. Refer to the following steps. 

We request you to use the corresponding custom font base64 string in your application.  
 
  1. Download TTF file for the corresponding (custom) font (https://www.fontsquirrel.com/fonts/list/language/turkish )
  2. Then convert the TTF file into base64 string (https://www.giftofspeed.com/base64-encoder/).
  3. Finally apply the base64 string to pdfTrupetypeFont.

import { data, base64_Turkishfont } from './datasource'; 
 
@Component({ 
  selector: 'app-root', 
  template: `<ejs-grid [dataSource]='data' [allowGrouping]='true' [allowPaging]='true' 
  [toolbar]='toolbar' (toolbarClick)='toolbarClick($event)'  
        [allowExcelExport]='true' [pageSettings]='pageSettings' [allowPdfExport]='true'> 
                <e-columns> 
                    <e-column field='OrderID' headerText='รหัสคำสั่งซื้อ' textAlign='Right' width=90></e-column> 
                </e-columns> 
                </ejs-grid>`, 
  providers: [ToolbarService, PageService, ExcelExportService, PdfExportService] 
}) 
export class AppComponent implements OnInit { 
 
  public gridData: Object[]; 
  public toolbar: string[]; 
  public pageSettings: Object; 
  @ViewChild('grid') 
  public grid: GridComponent; 
  . . . . . 
toolbarClick(args: ClickEventArgs): void { 
  let id: any = document.getElementsByClassName('e-grid')[0].id + '_pdfexport'; 
  let grid: any =  (document.getElementsByClassName('e-grid')[0] as any).ej2_instances[0]; 
    if (args.item.id === id) { 
        let pdfExportProperties: PdfExportProperties = { 
            theme: { 
                header: {font:  new PdfTrueTypeFont(base64_Turkishfont, 12) }, 
                caption: { font: new PdfTrueTypeFont(base64ThaiFont, 10) }, 
                record: { font: new PdfTrueTypeFont(base64ThaiFont, 9) } 
            } 
        }; 
       this.grid.pdfExport(pdfExportProperties); 
    } 
} 
} 



NOTE: We have used TURKISH-regular font . If you have any custom font you can convert it to base64  and replace it in ‘base64_Turkishfont’

Regards, 
Seeni Sakthi Kumar S 


kenan dogan
Replied On September 7, 2019 03:20 PM UTC

Thank you, You're perfect :)

Seeni Sakthi Kumar Seeni Raj [Syncfusion]
Replied On September 9, 2019 12:12 PM UTC

Hi Kenan,  
  
Thanks for your update.

We are happy to hear that your requirement has been achieved and you are good to go. Please get back to us, if you require further assistance.

Regards,  
Seeni Sakthi Kumar S 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon