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

    Parameters

    filename
    Filename of TrueType font.

    Return Value

    CID PdfFont.
    Example

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

    
    ''' <summary>
    ''' Creates CID 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 Shared Sub CreateCIDFont(pdfFilename As String, trueTypeFontFilename As String)
        ' open PDF document
        Using document As New Vintasoft.Imaging.Pdf.PdfDocument(pdfFilename)
            ' create CID font of PDF document based on TrueType font
                '...
            Dim newFont As Vintasoft.Imaging.Pdf.Tree.Fonts.PdfFont = document.FontManager.CreateCIDFontFromTrueTypeFont(trueTypeFontFilename)
        End Using
    End Sub
    
    
    
    /// <summary>
    /// Creates CID 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 CreateCIDFont(string pdfFilename, string trueTypeFontFilename)
    {
        // open PDF document
        using (Vintasoft.Imaging.Pdf.PdfDocument document = new Vintasoft.Imaging.Pdf.PdfDocument(pdfFilename))
        {
            // create CID font of PDF document based on TrueType font
            Vintasoft.Imaging.Pdf.Tree.Fonts.PdfFont newFont = 
                document.FontManager.CreateCIDFontFromTrueTypeFont(trueTypeFontFilename);
            //...
        }
    }
    
    

    Requirements

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

    See Also