VintaSoft Imaging .NET SDK 12.4: Documentation for .NET developer
Vintasoft.Imaging.Pdf Namespace / PdfFontManager Class / CreateSimpleFontFromTrueTypeFont Methods / CreateSimpleFontFromTrueTypeFont(String) Method
Syntax Example Requirements SeeAlso
In This Topic
    CreateSimpleFontFromTrueTypeFont(String) Method (PdfFontManager)
    In This Topic
    Creates a simple font based on TrueType font file.
    Syntax
    'Declaration
    
    Public Overloads Function CreateSimpleFontFromTrueTypeFont( _
    ByVal filename
    Filename of the TrueType font.
    As System.String _
    ) As Vintasoft.Imaging.Pdf.Tree.Fonts.PdfFont
    public Vintasoft.Imaging.Pdf.Tree.Fonts.PdfFont CreateSimpleFontFromTrueTypeFont(
    System.String filename
    )
    public: Vintasoft.Imaging.Pdf.Tree.Fonts.PdfFont* CreateSimpleFontFromTrueTypeFont(
    System.String filename
    )
    public:
    Vintasoft.Imaging.Pdf.Tree.Fonts.PdfFont^ CreateSimpleFontFromTrueTypeFont(
    System.String filename
    )

    Parameters

    filename
    Filename of the TrueType font.

    Return Value

    Simple PdfFont.
    Example

    Here is an example that shows how to create a simple PDF font, which is based on TrueType font:

    
    /// <summary>
    /// Create font of PDF document based on TrueType font.
    /// </summary>
    /// <param name="pdfFilename">The filename of PDF document.</param>
    /// <param name="trueTypeFontFilename">The filename of TrueType font.</param>
    public static void CreateSimpleFont(string pdfFilename, string trueTypeFontFilename)
    {
        // open PDF document
        using (Vintasoft.Imaging.Pdf.PdfDocument document = 
            new Vintasoft.Imaging.Pdf.PdfDocument(pdfFilename))
        {
            // create font of PDF document based on TrueType font
            Vintasoft.Imaging.Pdf.Tree.Fonts.PdfFont newFont = 
                document.FontManager.CreateSimpleFontFromTrueTypeFont(trueTypeFontFilename);
            //...
        }
    }
    
    
    
    /// <summary>
    /// Create font of PDF document based on TrueType font.
    /// </summary>
    /// <param name="pdfFilename">The filename of PDF document.</param>
    /// <param name="trueTypeFontFilename">The filename of TrueType font.</param>
    public static void CreateSimpleFont(string pdfFilename, string trueTypeFontFilename)
    {
        // open PDF document
        using (Vintasoft.Imaging.Pdf.PdfDocument document = 
            new Vintasoft.Imaging.Pdf.PdfDocument(pdfFilename))
        {
            // create font of PDF document based on TrueType font
            Vintasoft.Imaging.Pdf.Tree.Fonts.PdfFont newFont = 
                document.FontManager.CreateSimpleFontFromTrueTypeFont(trueTypeFontFilename);
            //...
        }
    }
    
    

    Requirements

    Target Platforms: .NET 8; .NET 7; .NET 6; .NET Framework 4.8, 4.7, 4.6, 4.5, 4.0, 3.5

    See Also