menu

WinForms

  • Code Examples
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Enum PdfFontStyle - WindowsForms API Reference | Syncfusion

    Show / Hide Table of Contents

    Enum PdfFontStyle

    Specifies style information applied to text.

    Namespace: Syncfusion.Pdf.Graphics
    Assembly: Syncfusion.Pdf.Base.dll
    Syntax
    [Flags]
    public enum PdfFontStyle
    Examples
    //Create a new PDF document.
    PdfDocument document = new PdfDocument();
    //Add a page to the document.
    PdfPage page = document.Pages.Add();
    //Create PDF graphics for the page.
    PdfGraphics graphics = page.Graphics;
    //Create a new PDF font instance.
    PdfFont font = new PdfStandardFont(PdfFontFamily.Helvetica, 12, PdfFontStyle.Bold);
    //Draw string to PDF page.
    graphics.DrawString("Hello World!", font, PdfBrushes.Black, PointF.Empty);
    //Save the document.
    document.Save("Output.pdf");
    //Close the document.
    document.Close(true);
    'Create a new PDF document.
    Dim document As New PdfDocument()
    'Add a page to the document.
    Dim page As PdfPage = document.Pages.Add()
    'Create PDF graphics for the page.
    Dim graphics As PdfGraphics = page.Graphics
    'Create a new PDF font instance.
    Dim font As PdfFont = New PdfStandardFont(PdfFontFamily.Helvetica, 12, PdfFontStyle.Bold)
    'Draw string to PDF page.
    graphics.DrawString("Hello World!", font, PdfBrushes.Black, PointF.Empty)
    'Save the document.
    document.Save("Output.pdf")
    'Close the document.
    document.Close(True)

    Fields

    Name Description
    Bold

    Bold text.

    Italic

    Italic text.

    Regular

    Normal text.

    Strikeout

    Strikeout text.

    Underline

    Represents the underline text.

    Back to top Generated by DocFX
    Copyright © 2001 - 2025 Syncfusion Inc. All Rights Reserved