Font not found in android platform.

Ali2023

New member
Joined
Nov 7, 2023
Messages
1
Programming Experience
Beginner
In my .net maui project. I use QuestPdf to generate a pdf file. the code works fine in windows but in android tells me that the font is not found.

my code:
C#:
var pdfDocument = Document.Create(container =>

{  
container.Page(page =>
{

page.Size(PageSizes.A4);

page.Margin(1, Unit.Centimetre);

page.PageColor(Colors.White);

page.DefaultTextStyle(x =>

x.FontFamily("Calibri"));


});
}
 
Last edited by a moderator:
I haven't used this library, but found a couple of things online. Release notes for 2022.8 says this:
- Breaking change: changed default font from Calibri to an open-source Lato,
- Default font files are included with the nuget package, making it safe to deploy on any environment,

Release notes for 2022.9 describes a font fallback configuration option: Release QuestPDF 2022.9 release notes · QuestPDF/QuestPDF

Then there is this help page about loading custom fonts that you bundle yourself: Font management | QuestPDF
 
Back
Top Bottom