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. Image for the cookie policy date

the error when customize font

Hi guys
I was trying to use export pdf in pivot table. And tried to give him a special font, because before I received the following error:

 ERROR Error: Uncaught (in promise): Error: ArgumentOutOfRangeException:index, The character is not supported by the font.
Error: ArgumentOutOfRangeException:index, The character is not supported by the font.

But I changed the code from a tutorial to the following: I get the above and the following:

this.pdfExportProperties = {
theme: {
header: {font: new PdfTrueTypeFont(this.iransans, 12) },
caption: { font: new PdfTrueTypeFont(this.iransans, 10) },
record: { font: new PdfTrueTypeFont(this.iransans, 9) }
}
};
this is error : 
TestComponent_Host.ngfactory.js? [sm]:1 ERROR Error: Can not read TTF font data
    at TtfReader.push../node_modules/@syncfusion/ej2-pdf-export/src/implementation/graphics/fonts/ttf-reader.js.TtfReader.checkPreambula (default~goal-goal-module~test-test-module.js:127710)
    at TtfReader.push../node_modules/@syncfusion/ej2-pdf-export/src/implementation/graphics/fonts/ttf-reader.js.TtfReader.readFontDictionary (default~goal-goal-module~test-test-module.js:127655)
    at TtfReader.push../node_modules/@syncfusion/ej2-pdf-export/src/implementation/graphics/fonts/ttf-reader.js.TtfReader.initialize (default~goal-goal-module~test-test-module.js:127647)
    at new TtfReader (default~goal-goal-module~test-test-module.js:127587)
    at UnicodeTrueTypeFont.push../node_modules/@syncfusion/ej2-pdf-export/src/implementation/graphics/fonts/unicode-true-type-font.js.UnicodeTrueTypeFont.Initialize (default~goal-goal-module~test-test-module.js:128995)
    at new UnicodeTrueTypeFont (default~goal-goal-module~test-test-module.js:128962)
    at PdfTrueTypeFont.push../node_modules/@syncfusion/ej2-pdf-export/src/implementation/graphics/fonts/pdf-true-type-font.js.PdfTrueTypeFont.createFontInternal (default~goal-goal-module~test-test-module.js:124517)
    at new PdfTrueTypeFont (default~goal-goal-module~test-test-module.js:124483)
    at TestComponent.push../src/app/test/test.component.ts.TestComponent.ngOnInit (test-test-module.js:223431)
    at checkAndUpdateDirectiveInline (vendor.js:83437)
what is the problem ? Note also that the words that become pdf s are Arabic words.

1 Reply

SA Scintilla Arul Jothi Raj Syncfusion Team September 20, 2019 10:03 AM UTC

Hi Mahdi, 

Thanks for contacting Syncfusion support. 

We have analyzed your query and the reported problem could not be reproduced at our end. Meanwhile, we have prepared a sample with a custom font.  


If this does not match your scenario, kindly either reproduce the problem in the above sample or share the issue reproduced sample which would be helpful for us to proceed further. 

Regards, 
Scintilla A 


Loader.
Live Chat Icon For mobile
Up arrow icon