VintaSoft Imaging .NET SDK 14.0: Документация для .NET разработчика
Vintasoft.Imaging.Pdf Namespace / PdfFontManager Class / CreateSimpleFontFromTrueTypeFont Methods / CreateSimpleFontFromTrueTypeFont(String) Method
Синтаксис Example Требования Смотрите также
В этом разделе
    CreateSimpleFontFromTrueTypeFont(String) Метод (PdfFontManager)
    В этом разделе
    Создает простой шрифт на основе файла шрифта TrueType.
    Синтаксис
    'Declaration
    
    Public Overloads Function CreateSimpleFontFromTrueTypeFont( _
    ByVal filename
    Имя файла шрифта TrueType.
    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
    Имя файла шрифта TrueType.

    Return Value

    Простой PdfFont.
    Пример

    Вот пример, показывающий, как создать простой шрифт PDF, основанный на шрифте TrueType:

    
    /// <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);
            //...
        }
    }
    
    

    Требования

    Целевые платформы: .NET 8; .NET 7; .NET 6; .NET Framework 4.8, 4.7, 4.6, 4.5, 4.0, 3.5

    Смотрите также