GetStandardFont(PdfStandardFontType) Method (PdfFontManager)
Returns the standard font of specified type.
Here is an example that shows how to create a PDF font, which is based on standard Times-Roman font:
''' <summary>
''' Creates font of PDF document based on "Times-Roman".
''' </summary>
''' <param name="pdfFilename">The filename of PDF document.</param>
Public Shared Sub CreateStandartFont(pdfFilename As String)
' open PDF document
Using document As New Vintasoft.Imaging.Pdf.PdfDocument(pdfFilename)
' create font based on "Times-Roman" font
'...
Dim timesRomanFont As Vintasoft.Imaging.Pdf.Tree.Fonts.PdfFont = document.FontManager.GetStandardFont(Vintasoft.Imaging.Pdf.Tree.Fonts.PdfStandardFontType.TimesRoman)
End Using
End Sub
/// <summary>
/// Creates font of PDF document based on "Times-Roman".
/// </summary>
/// <param name="pdfFilename">The filename of PDF document.</param>
public static void CreateStandartFont(string pdfFilename)
{
// open PDF document
using (Vintasoft.Imaging.Pdf.PdfDocument document = new Vintasoft.Imaging.Pdf.PdfDocument(pdfFilename))
{
// create font based on "Times-Roman" font
Vintasoft.Imaging.Pdf.Tree.Fonts.PdfFont timesRomanFont = document.FontManager.GetStandardFont(
Vintasoft.Imaging.Pdf.Tree.Fonts.PdfStandardFontType.TimesRoman);
//...
}
}
Target Platforms: .NET9; .NET 8; .NET 7; .NET 6; .NET Framework 4.8, 4.7, 4.6, 4.5, 4.0, 3.5