Problem with TFontMapping.DontReplaceFonts on Android

Hi team,

we are using your products for several years and this year we have decided to move forward and update our android project to .net6.
We have updated TMS.FlexCel nuget to version to 7.16.0 and expected that everything will work as before.
But when we try to export pdf file, we get and error:
FlexCel.Core.FlexCelCoreException: 'The folder "@" does not contain any file of type "*.ttf".'

If we try to copy folder with fonts into device and set the path in GetFontFolder event, then the pdf file is generated correctly, but we we would like avoid using this event...

Could you please take a look at provided test app and help us identify what we are doing wrong? (1.3 MB)

Kind regards,

This is indeed a bug in 7.16. When converting from Xamarin to .Net 6, ms stopped using the "Assets" folder, and now they are in "Resources" (see the note at FlexCel Android Guide | FlexCel Studio for the .NET Framework documentation )

But old code should still work, and it was a bug we introduced when adding support for the "Resources" folder. Right now, the simplest solution is to have the "OnGetFontFolder" to be:

      private void PdfOnGetFontFolder(object sender, GetFontFolderEventArgs e)
            e.FontPath = "@fonts";
            e.Applied = true;

7.17 will restore the behavior to the original one, but in the meantime, this should work. (you will also need to copy Calibri to the fonts folder for this to work)

This topic was automatically closed 60 minutes after the last reply. New replies are no longer allowed.