Class PdfSubSuperScript
Specifies type of the SubSuperScript.
Inheritance
System.Object
PdfSubSuperScript
Namespace: Syncfusion.Pdf.Graphics
Assembly: Syncfusion.Pdf.NET.dll
Syntax
public sealed class PdfSubSuperScript : Enum
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);
//Create a new PDF string format instance.
PdfStringFormat format = new PdfStringFormat();
//Set the text alignment.
format.Alignment = PdfTextAlignment.Center;
//Set the line alignment.
format.LineAlignment = PdfVerticalAlignment.Middle;
//Set character spacing.
format.CharacterSpacing = 1;
//Set clip path.
format.ClipPath = true;
//Set line limit.
format.LineLimit = true;
//Set line spacing.
format.LineSpacing = 1.1f;
//Set measure trailing spaces.
format.MeasureTrailingSpaces = true;
//Set no clip
format.NoClip = true;
//Set paragraph indent.
format.ParagraphIndent = 2.1f;
//Set right to left.
format.RightToLeft = false;
//Set word spacing.
format.WordSpacing = 1.5f;
//Set word wrap type.
format.WordWrap = PdfWordWrapType.Word;
//Set sub/super script type.
format.SubSuperScript = PdfSubSuperScript.SubScript;
//Draw string to PDF page.
graphics.DrawString("Hello World!", font, PdfBrushes.Black, new RectangleF(0, 0, 200, 100), format);
//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)
'Create a new PDF string format instance.
Dim format As PdfStringFormat = New PdfStringFormat()
'Set the text alignment.
format.Alignment = PdfTextAlignment.Center
'Set the line alignment.
format.LineAlignment = PdfVerticalAlignment.Middle;
'Set character spacing.
format.CharacterSpacing = 1
'Set clip path.
format.ClipPath = True
'Set line limit.
format.LineLimit = True
'Set line spacing.
format.LineSpacing = 1.1F
'Set measure trailing spaces.
format.MeasureTrailingSpaces = True
'Set no clip
format.NoClip = True
'Set paragraph indent.
format.ParagraphIndent = 2.1F
'Set right to left.
format.RightToLeft = False
'Set word spacing.
format.WordSpacing = 1.5F
'Set word wrap type.
format.WordWrap = PdfWordWrapType.Word
'Set sub/super script type.
format.SubSuperScript = PdfSubSuperScript.SubScript
'Draw string to PDF page.
graphics.DrawString("Hello World!", font, PdfBrushes.Black, New RectangleF(0, 0, 200, 100), format);
'Save the document.
document.Save("Output.pdf")
'Close the document.
document.Close(True)
Fields
None
Specifies no subscript or superscript.
Declaration
public const PdfSubSuperScript None
Field Value
Type |
---|
PdfSubSuperScript |
SubScript
Specifies subscript format.
Declaration
public const PdfSubSuperScript SubScript
Field Value
Type |
---|
PdfSubSuperScript |
SuperScript
Specifies superscript format.
Declaration
public const PdfSubSuperScript SuperScript
Field Value
Type |
---|
PdfSubSuperScript |