Hello,
Hi Boris,
//open document<o:p></o:p>
Document pdfDocument = new Document();
Aspose.Pdf.Page section = pdfDocument.Pages.Add();
TextFragment t = new TextFragment("Sample Text in Humnst777 BT font");
// to find font in system font folder
Aspose.Pdf.Text.Font font1 = FontRepository.OpenFont(@"C:\Users\Home\Downloads\fonts\HUM777N.ttf");
Console.WriteLine(font1.FontName);
Aspose.Pdf.Text.Font font = FontRepository.FindFont("Humanist777BT");
Console.WriteLine(font.FontName);
t.TextState.Font = font;
// to open a font with complete path
TextFragment t1 = new TextFragment("Sample Text in OCR B 10 BT font");
// to find font in system font folder
t1.TextState.Font = FontRepository.FindFont("OCR-B10PitchBT");
section.Paragraphs.Add(t);
section.Paragraphs.Add(t1);
pdfDocument.Save(myDir + "Custom_Fonts_out.pdf");
Please feel free to contact us for any further assistance.
Best Regards,
Hello,
Hi Boris,