this is the error : No appropriate font found for family name Arial .Implement IFontResolver and assign to GlobalFontSettings.FontResolver to use fonts
using (SaveFileDialog sfd = new SaveFileDialog() )
{
if (sfd.ShowDialog() == DialogResult.OK)
{
PdfDocument doc = new PdfDocument();
doc.Info.Title = "PDF";
PdfPage page = doc.AddPage();
XGraphics gfx = XGraphics.FromPdfPage(page);
XFont font = new XFont("Arial", 25);
for (int i = 0; i < txtBoxList.Count; i++)
{
gfx.DrawString(txtBoxList[i].Text, font, XBrushes.Black, new XPoint(0, 0));
}
doc.Save(sfd.FileName);
}
In some textbox i write some text and i want to save in a pdf , put gives me this error and i dont know what to do
New contributor
Alexandra A is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.