Class PdfMarker
Represents base class for markers.
Namespace: Syncfusion.Pdf.Lists
Assembly: Syncfusion.Pdf.NET.dll
Syntax
public abstract class PdfMarker : Object
Examples
//Create a new instance of PdfDocument class.
PdfDocument document = new PdfDocument();
//Add a new page to the document.
PdfPage page = document.Pages.Add();
//Get the PDF page graphics.
PdfGraphics graphics = page.Graphics;
SizeF size = page.Graphics.ClientSize;
//Create font
PdfFont font = new PdfStandardFont(PdfFontFamily.TimesRoman, 10, PdfFontStyle.Italic);
//Create string format
PdfStringFormat format = new PdfStringFormat();
format.LineSpacing = 10f;
//Create Ordered list
PdfOrderedList list = new PdfOrderedList();
//Create new order list marker.
PdfOrderedMarker marker = new PdfOrderedMarker(PdfNumberStyle.Numeric, font);
//Set marker brush.
marker.Brush = PdfBrushes.Black;
//Set marker to the ordered list.
list.Marker = marker;
//Set line indent.
list.Indent = 20;
//Set format for sub list.
list.Font = font;
list.StringFormat = format;
//Add items to the list
list.Items.Add("PDF");
list.Items.Add("XlsIO");
list.Items.Add("DocIO");
list.Items.Add("PPT");
//Draw the PDF list to page.
list.Draw(page, new RectangleF(0, 20, size.Width, size.Height));
// Save and close the document.
document.Save("Output.pdf");
document.Close(true);
'Create a new instance of PdfDocument class.
Dim document As New PdfDocument()
'Add a new page to the document.
Dim page As PdfPage = document.Pages.Add()
'Get the PDF page graphics.
Dim graphics As PdfGraphics = page.Graphics
Dim size As SizeF = page.Graphics.ClientSize
'Create font
Dim font As PdfFont = New PdfStandardFont(PdfFontFamily.TimesRoman, 10, PdfFontStyle.Italic)
'Create string format
Dim format As New PdfStringFormat()
format.LineSpacing = 10F
'Create Ordered list
Dim list As New PdfOrderedList()
'Create new order list marker.
Dim marker As New PdfOrderedMarker(PdfNumberStyle.Numeric, font)
'Set marker brush.
marker.Brush = PdfBrushes.Black
'Set marker to the ordered list.
list.Marker = marker
'Set line indent.
list.Indent = 20
'Set format for sub list
list.Font = font
list.StringFormat = format
'Add items to the list
list.Items.Add("PDF")
list.Items.Add("XlsIO")
list.Items.Add("DocIO")
list.Items.Add("PPT")
'Draw the PDF list to page.
list.Draw(page, New RectangleF(0, 20, size.Width, size.Height))
' Save and close the document.
document.Save("Output.pdf")
document.Close(True)
Constructors
PdfMarker()
Declaration
protected PdfMarker()
Properties
Alignment
Gets or sets a value indicating whether the marker is situated at the left of the list or at the right of the list.
Declaration
public PdfListMarkerAlignment Alignment { get; set; }
Property Value
Type |
---|
PdfListMarkerAlignment |
Examples
//Create a new instance of PdfDocument class.
PdfDocument document = new PdfDocument();
//Add a new page to the document.
PdfPage page = document.Pages.Add();
//Get the PDF page graphics.
PdfGraphics graphics = page.Graphics;
SizeF size = page.Graphics.ClientSize;
//Create font
PdfFont font = new PdfStandardFont(PdfFontFamily.TimesRoman, 10, PdfFontStyle.Italic);
//Create string format
PdfStringFormat format = new PdfStringFormat();
format.LineSpacing = 10f;
//Create Ordered list
PdfOrderedList list = new PdfOrderedList();
//Create new order list marker.
PdfOrderedMarker marker = new PdfOrderedMarker(PdfNumberStyle.Numeric, font);
//Set marker brush.
marker.Brush = PdfBrushes.Black;
//Set font.
marker.Font = font;
//Set pen.
marker.Pen = PdfPens.Red;
//Set marker alignment.
marker.Alignment = PdfListMarkerAlignment.Left;
//Set marker string format.
marker.StringFormat = new PdfStringFormat(PdfTextAlignment.Left);
//Set marker to the ordered list.
list.Marker = marker;
//Set line indent.
list.Indent = 20;
//Set format for sub list.
list.Font = font;
list.StringFormat = format;
//Add items to the list
list.Items.Add("PDF");
list.Items.Add("XlsIO");
list.Items.Add("DocIO");
list.Items.Add("PPT");
//Draw the PDF list to page.
list.Draw(page, new RectangleF(0, 20, size.Width, size.Height));
// Save and close the document.
document.Save("Output.pdf");
document.Close(true);
'Create a new instance of PdfDocument class.
Dim document As New PdfDocument()
'Add a new page to the document.
Dim page As PdfPage = document.Pages.Add()
'Get the PDF page graphics.
Dim graphics As PdfGraphics = page.Graphics
Dim size As SizeF = page.Graphics.ClientSize
'Create font
Dim font As PdfFont = New PdfStandardFont(PdfFontFamily.TimesRoman, 10, PdfFontStyle.Italic)
'Create string format
Dim format As New PdfStringFormat()
format.LineSpacing = 10F
'Create Ordered list
Dim list As New PdfOrderedList()
'Create new order list marker.
Dim marker As New PdfOrderedMarker(PdfNumberStyle.Numeric, font)
'Set marker brush.
marker.Brush = PdfBrushes.Black
'Set font.
marker.Font = font
'Set pen.
marker.Pen = PdfPens.Red
'Set marker alignment.
marker.Alignment = PdfListMarkerAlignment.Left
'Set marker string format.
marker.StringFormat = New PdfStringFormat(PdfTextAlignment.Left)
'Set marker to the ordered list.
list.Marker = marker
'Set line indent.
list.Indent = 20
'Set format for sub list
list.Font = font
list.StringFormat = format
'Add items to the list
list.Items.Add("PDF")
list.Items.Add("XlsIO")
list.Items.Add("DocIO")
list.Items.Add("PPT")
'Draw the PDF list to page.
list.Draw(page, New RectangleF(0, 20, size.Width, size.Height))
' Save and close the document.
document.Save("Output.pdf")
document.Close(True)
Brush
Gets or sets marker brush.
Declaration
public PdfBrush Brush { get; set; }
Property Value
Type |
---|
PdfBrush |
Examples
//Create a new instance of PdfDocument class.
PdfDocument document = new PdfDocument();
//Add a new page to the document.
PdfPage page = document.Pages.Add();
//Get the PDF page graphics.
PdfGraphics graphics = page.Graphics;
SizeF size = page.Graphics.ClientSize;
//Create font
PdfFont font = new PdfStandardFont(PdfFontFamily.TimesRoman, 10, PdfFontStyle.Italic);
//Create string format
PdfStringFormat format = new PdfStringFormat();
format.LineSpacing = 10f;
//Create Ordered list
PdfOrderedList list = new PdfOrderedList();
//Create new order list marker.
PdfOrderedMarker marker = new PdfOrderedMarker(PdfNumberStyle.Numeric, font);
//Set marker brush.
marker.Brush = PdfBrushes.Black;
//Set font.
marker.Font = font;
//Set pen.
marker.Pen = PdfPens.Red;
//Set marker alignment.
marker.Alignment = PdfListMarkerAlignment.Left;
//Set marker string format.
marker.StringFormat = new PdfStringFormat(PdfTextAlignment.Left);
//Set marker to the ordered list.
list.Marker = marker;
//Set line indent.
list.Indent = 20;
//Set format for sub list.
list.Font = font;
list.StringFormat = format;
//Add items to the list
list.Items.Add("PDF");
list.Items.Add("XlsIO");
list.Items.Add("DocIO");
list.Items.Add("PPT");
//Draw the PDF list to page.
list.Draw(page, new RectangleF(0, 20, size.Width, size.Height));
// Save and close the document.
document.Save("Output.pdf");
document.Close(true);
'Create a new instance of PdfDocument class.
Dim document As New PdfDocument()
'Add a new page to the document.
Dim page As PdfPage = document.Pages.Add()
'Get the PDF page graphics.
Dim graphics As PdfGraphics = page.Graphics
Dim size As SizeF = page.Graphics.ClientSize
'Create font
Dim font As PdfFont = New PdfStandardFont(PdfFontFamily.TimesRoman, 10, PdfFontStyle.Italic)
'Create string format
Dim format As New PdfStringFormat()
format.LineSpacing = 10F
'Create Ordered list
Dim list As New PdfOrderedList()
'Create new order list marker.
Dim marker As New PdfOrderedMarker(PdfNumberStyle.Numeric, font)
'Set marker brush.
marker.Brush = PdfBrushes.Black
'Set font.
marker.Font = font
'Set pen.
marker.Pen = PdfPens.Red
'Set marker alignment.
marker.Alignment = PdfListMarkerAlignment.Left
'Set marker string format.
marker.StringFormat = New PdfStringFormat(PdfTextAlignment.Left)
'Set marker to the ordered list.
list.Marker = marker
'Set line indent.
list.Indent = 20
'Set format for sub list
list.Font = font
list.StringFormat = format
'Add items to the list
list.Items.Add("PDF")
list.Items.Add("XlsIO")
list.Items.Add("DocIO")
list.Items.Add("PPT")
'Draw the PDF list to page.
list.Draw(page, New RectangleF(0, 20, size.Width, size.Height))
' Save and close the document.
document.Save("Output.pdf")
document.Close(True)
Font
Gets or sets marker font.
Declaration
public PdfFont Font { get; set; }
Property Value
Type |
---|
PdfFont |
Examples
//Create a new instance of PdfDocument class.
PdfDocument document = new PdfDocument();
//Add a new page to the document.
PdfPage page = document.Pages.Add();
//Get the PDF page graphics.
PdfGraphics graphics = page.Graphics;
SizeF size = page.Graphics.ClientSize;
//Create font
PdfFont font = new PdfStandardFont(PdfFontFamily.TimesRoman, 10, PdfFontStyle.Italic);
//Create string format
PdfStringFormat format = new PdfStringFormat();
format.LineSpacing = 10f;
//Create Ordered list
PdfOrderedList list = new PdfOrderedList();
//Create new order list marker.
PdfOrderedMarker marker = new PdfOrderedMarker(PdfNumberStyle.Numeric, font);
//Set marker brush.
marker.Brush = PdfBrushes.Black;
//Set font.
marker.Font = font;
//Set pen.
marker.Pen = PdfPens.Red;
//Set marker alignment.
marker.Alignment = PdfListMarkerAlignment.Left;
//Set marker string format.
marker.StringFormat = new PdfStringFormat(PdfTextAlignment.Left);
//Set marker to the ordered list.
list.Marker = marker;
//Set line indent.
list.Indent = 20;
//Set format for sub list.
list.Font = font;
list.StringFormat = format;
//Add items to the list
list.Items.Add("PDF");
list.Items.Add("XlsIO");
list.Items.Add("DocIO");
list.Items.Add("PPT");
//Draw the PDF list to page.
list.Draw(page, new RectangleF(0, 20, size.Width, size.Height));
// Save and close the document.
document.Save("Output.pdf");
document.Close(true);
'Create a new instance of PdfDocument class.
Dim document As New PdfDocument()
'Add a new page to the document.
Dim page As PdfPage = document.Pages.Add()
'Get the PDF page graphics.
Dim graphics As PdfGraphics = page.Graphics
Dim size As SizeF = page.Graphics.ClientSize
'Create font
Dim font As PdfFont = New PdfStandardFont(PdfFontFamily.TimesRoman, 10, PdfFontStyle.Italic)
'Create string format
Dim format As New PdfStringFormat()
format.LineSpacing = 10F
'Create Ordered list
Dim list As New PdfOrderedList()
'Create new order list marker.
Dim marker As New PdfOrderedMarker(PdfNumberStyle.Numeric, font)
'Set marker brush.
marker.Brush = PdfBrushes.Black
'Set font.
marker.Font = font
'Set pen.
marker.Pen = PdfPens.Red
'Set marker alignment.
marker.Alignment = PdfListMarkerAlignment.Left
'Set marker string format.
marker.StringFormat = New PdfStringFormat(PdfTextAlignment.Left)
'Set marker to the ordered list.
list.Marker = marker
'Set line indent.
list.Indent = 20
'Set format for sub list
list.Font = font
list.StringFormat = format
'Add items to the list
list.Items.Add("PDF")
list.Items.Add("XlsIO")
list.Items.Add("DocIO")
list.Items.Add("PPT")
'Draw the PDF list to page.
list.Draw(page, New RectangleF(0, 20, size.Width, size.Height))
' Save and close the document.
document.Save("Output.pdf")
document.Close(True)
Pen
Gets or sets marker pen.
Declaration
public PdfPen Pen { get; set; }
Property Value
Type |
---|
PdfPen |
Examples
//Create a new instance of PdfDocument class.
PdfDocument document = new PdfDocument();
//Add a new page to the document.
PdfPage page = document.Pages.Add();
//Get the PDF page graphics.
PdfGraphics graphics = page.Graphics;
SizeF size = page.Graphics.ClientSize;
//Create font
PdfFont font = new PdfStandardFont(PdfFontFamily.TimesRoman, 10, PdfFontStyle.Italic);
//Create string format
PdfStringFormat format = new PdfStringFormat();
format.LineSpacing = 10f;
//Create Ordered list
PdfOrderedList list = new PdfOrderedList();
//Create new order list marker.
PdfOrderedMarker marker = new PdfOrderedMarker(PdfNumberStyle.Numeric, font);
//Set marker brush.
marker.Brush = PdfBrushes.Black;
//Set font.
marker.Font = font;
//Set pen.
marker.Pen = PdfPens.Red;
//Set marker alignment.
marker.Alignment = PdfListMarkerAlignment.Left;
//Set marker string format.
marker.StringFormat = new PdfStringFormat(PdfTextAlignment.Left);
//Set marker to the ordered list.
list.Marker = marker;
//Set line indent.
list.Indent = 20;
//Set format for sub list.
list.Font = font;
list.StringFormat = format;
//Add items to the list
list.Items.Add("PDF");
list.Items.Add("XlsIO");
list.Items.Add("DocIO");
list.Items.Add("PPT");
//Draw the PDF list to page.
list.Draw(page, new RectangleF(0, 20, size.Width, size.Height));
// Save and close the document.
document.Save("Output.pdf");
document.Close(true);
'Create a new instance of PdfDocument class.
Dim document As New PdfDocument()
'Add a new page to the document.
Dim page As PdfPage = document.Pages.Add()
'Get the PDF page graphics.
Dim graphics As PdfGraphics = page.Graphics
Dim size As SizeF = page.Graphics.ClientSize
'Create font
Dim font As PdfFont = New PdfStandardFont(PdfFontFamily.TimesRoman, 10, PdfFontStyle.Italic)
'Create string format
Dim format As New PdfStringFormat()
format.LineSpacing = 10F
'Create Ordered list
Dim list As New PdfOrderedList()
'Create new order list marker.
Dim marker As New PdfOrderedMarker(PdfNumberStyle.Numeric, font)
'Set marker brush.
marker.Brush = PdfBrushes.Black
'Set font.
marker.Font = font
'Set pen.
marker.Pen = PdfPens.Red
'Set marker alignment.
marker.Alignment = PdfListMarkerAlignment.Left
'Set marker string format.
marker.StringFormat = New PdfStringFormat(PdfTextAlignment.Left)
'Set marker to the ordered list.
list.Marker = marker
'Set line indent.
list.Indent = 20
'Set format for sub list
list.Font = font
list.StringFormat = format
'Add items to the list
list.Items.Add("PDF")
list.Items.Add("XlsIO")
list.Items.Add("DocIO")
list.Items.Add("PPT")
'Draw the PDF list to page.
list.Draw(page, New RectangleF(0, 20, size.Width, size.Height))
' Save and close the document.
document.Save("Output.pdf")
document.Close(True)
StringFormat
Gets or sets the format.
Declaration
public PdfStringFormat StringFormat { get; set; }
Property Value
Type | Description |
---|---|
PdfStringFormat | The format. |
Examples
//Create a new instance of PdfDocument class.
PdfDocument document = new PdfDocument();
//Add a new page to the document.
PdfPage page = document.Pages.Add();
//Get the PDF page graphics.
PdfGraphics graphics = page.Graphics;
SizeF size = page.Graphics.ClientSize;
//Create font
PdfFont font = new PdfStandardFont(PdfFontFamily.TimesRoman, 10, PdfFontStyle.Italic);
//Create string format
PdfStringFormat format = new PdfStringFormat();
format.LineSpacing = 10f;
//Create Ordered list
PdfOrderedList list = new PdfOrderedList();
//Create new order list marker.
PdfOrderedMarker marker = new PdfOrderedMarker(PdfNumberStyle.Numeric, font);
//Set marker brush.
marker.Brush = PdfBrushes.Black;
//Set font.
marker.Font = font;
//Set pen.
marker.Pen = PdfPens.Red;
//Set marker alignment.
marker.Alignment = PdfListMarkerAlignment.Left;
//Set marker string format.
marker.StringFormat = new PdfStringFormat(PdfTextAlignment.Left);
//Set marker to the ordered list.
list.Marker = marker;
//Set line indent.
list.Indent = 20;
//Set format for sub list.
list.Font = font;
list.StringFormat = format;
//Add items to the list
list.Items.Add("PDF");
list.Items.Add("XlsIO");
list.Items.Add("DocIO");
list.Items.Add("PPT");
//Draw the PDF list to page.
list.Draw(page, new RectangleF(0, 20, size.Width, size.Height));
// Save and close the document.
document.Save("Output.pdf");
document.Close(true);
'Create a new instance of PdfDocument class.
Dim document As New PdfDocument()
'Add a new page to the document.
Dim page As PdfPage = document.Pages.Add()
'Get the PDF page graphics.
Dim graphics As PdfGraphics = page.Graphics
Dim size As SizeF = page.Graphics.ClientSize
'Create font
Dim font As PdfFont = New PdfStandardFont(PdfFontFamily.TimesRoman, 10, PdfFontStyle.Italic)
'Create string format
Dim format As New PdfStringFormat()
format.LineSpacing = 10F
'Create Ordered list
Dim list As New PdfOrderedList()
'Create new order list marker.
Dim marker As New PdfOrderedMarker(PdfNumberStyle.Numeric, font)
'Set marker brush.
marker.Brush = PdfBrushes.Black
'Set font.
marker.Font = font
'Set pen.
marker.Pen = PdfPens.Red
'Set marker alignment.
marker.Alignment = PdfListMarkerAlignment.Left
'Set marker string format.
marker.StringFormat = New PdfStringFormat(PdfTextAlignment.Left)
'Set marker to the ordered list.
list.Marker = marker
'Set line indent.
list.Indent = 20
'Set format for sub list
list.Font = font
list.StringFormat = format
'Add items to the list
list.Items.Add("PDF")
list.Items.Add("XlsIO")
list.Items.Add("DocIO")
list.Items.Add("PPT")
'Draw the PDF list to page.
list.Draw(page, New RectangleF(0, 20, size.Width, size.Height))
' Save and close the document.
document.Save("Output.pdf")
document.Close(True)