Table of Contents

Class PdfSectionPageNumberField

Namespace
Syncfusion.Pdf
Assembly
Syncfusion.Pdf.Portable.dll

Represents an automatic field to display page number within a section.

public class PdfSectionPageNumberField : PdfMultipleNumberValueField
Inheritance
PdfSectionPageNumberField
Inherited Members

Examples

//Create a new document.
PdfDocument document = new PdfDocument();
//Add the section.
PdfSection section = document.Sections.Add();
//Create a PDF font.
PdfFont font = new PdfStandardFont(PdfFontFamily.Helvetica, 12f);
//Create section page number field.
PdfSectionPageNumberField sectionPageNumber = new PdfSectionPageNumberField(font);
sectionPageNumber.NumberStyle = PdfNumberStyle.LowerRoman;
//Draw the sectionPageNumber in section.
for (int i = 0; i != 2; i++)
{
PdfPage page = section.Pages.Add();
sectionPageNumber.Draw(page.Graphics);
}
//Save the document.
document.Save("Output.pdf");
//Close the document.
document.Close(true);
'Create a new document.
Dim document As New PdfDocument()
'Add the section.
Dim section As PdfSection = document.Sections.Add()
'Create a PDF font.
Dim font As PdfFont = New PdfStandardFont(PdfFontFamily.Helvetica, 12.0F)
'Create section page number field.
Dim sectionPageNumber As New PdfSectionPageNumberField(font)
sectionPageNumber.NumberStyle = PdfNumberStyle.LowerRoman
'Draw the sectionPageNumber in section.
For i As Integer = 0 To 1
Dim page As PdfPage = section.Pages.Add()
sectionPageNumber.Draw(page.Graphics)
Next i
'Save the document.
document.Save("Output.pdf")
'Close the document.
document.Close(True)

Constructors

PdfSectionPageNumberField()

Initializes a new instance of the PdfSectionPageNumberField class.

public PdfSectionPageNumberField()

Examples

//Create a new document.
PdfDocument document = new PdfDocument();
//Add the section.
PdfSection section = document.Sections.Add();
//Create section page number field.
PdfSectionPageNumberField sectionPageNumber = new PdfSectionPageNumberField();
sectionPageNumber.NumberStyle = PdfNumberStyle.LowerRoman;
//Draw the sectionPageNumber in section.
for (int i = 0; i != 2; i++)
{
PdfPage page = section.Pages.Add();
sectionPageNumber.Draw(page.Graphics);
}
//Save the document.
document.Save("Output.pdf");
//Close the document.
document.Close(true);
'Create a new document.
Dim document As New PdfDocument()
'Add the section
Dim section As PdfSection = document.Sections.Add()
'Create section page number field.
Dim sectionPageNumber As New PdfSectionPageNumberField()
sectionPageNumber.NumberStyle = PdfNumberStyle.LowerRoman
'Draw the sectionPageNumber in section
For i As Integer = 0 To 1
Dim page As PdfPage = section.Pages.Add()
sectionPageNumber.Draw(page.Graphics)
Next i
'Save the document
document.Save("Output.pdf")
'Close the document
document.Close(True)
See Also

PdfSectionPageNumberField(PdfFont)

Initializes a new instance of the PdfSectionPageNumberField class.

public PdfSectionPageNumberField(PdfFont font)

Parameters

font PdfFont

The font.

Examples

//Create a new document.
PdfDocument document = new PdfDocument();
//Add the section.
PdfSection section = document.Sections.Add();
//Create a PDF font.
PdfFont font = new PdfStandardFont(PdfFontFamily.Helvetica, 12f);
//Create section page number field.
PdfSectionPageNumberField sectionPageNumber = new PdfSectionPageNumberField(font);
sectionPageNumber.NumberStyle = PdfNumberStyle.LowerRoman;
//Draw the sectionPageNumber in section.
for (int i = 0; i != 2; i++)
{
PdfPage page = section.Pages.Add();
sectionPageNumber.Draw(page.Graphics);
}
//Save the document.
document.Save("Output.pdf");
//Close the document.
document.Close(true);
'Create a new document.
Dim document As New PdfDocument()
'Add the section
Dim section As PdfSection = document.Sections.Add()
'Create a PDF font
Dim font As PdfFont = New PdfStandardFont(PdfFontFamily.Helvetica, 12.0F)
'Create section page number field.
Dim sectionPageNumber As New PdfSectionPageNumberField(font)
sectionPageNumber.NumberStyle = PdfNumberStyle.LowerRoman
'Draw the sectionPageNumber in section
For i As Integer = 0 To 1
Dim page As PdfPage = section.Pages.Add()
sectionPageNumber.Draw(page.Graphics)
Next i
'Save the document
document.Save("Output.pdf")
'Close the document
document.Close(True)
See Also

PdfSectionPageNumberField(PdfFont, RectangleF)

Initializes a new instance of the PdfSectionPageNumberField class.

public PdfSectionPageNumberField(PdfFont font, RectangleF bounds)

Parameters

font PdfFont

The font.

bounds RectangleF

The bounds.

Examples

//Create a new document.
PdfDocument document = new PdfDocument();
//Add the section.
PdfSection section = document.Sections.Add();
//Create a PDF font.
PdfFont font = new PdfStandardFont(PdfFontFamily.Helvetica, 12f);
//Create section page number field with  and 
PdfSectionPageNumberField sectionPageNumber = new PdfSectionPageNumberField(font);
sectionPageNumber.NumberStyle = PdfNumberStyle.LowerRoman;
//Draw the sectionPageNumber in section.
for (int i = 0; i != 2; i++)
{
PdfPage page = section.Pages.Add();
sectionPageNumber.Draw(page.Graphics);
}
//Save the document.
document.Save("Output.pdf");
//Close the document.
document.Close(true);
'Create a new document.
Dim document As New PdfDocument()
'Add the section
Dim section As PdfSection = document.Sections.Add()
'Create a PDF font
Dim font As PdfFont = New PdfStandardFont(PdfFontFamily.Helvetica, 12.0F)
Dim rect As RectangleF = New RectangleF(10, 10, 30, 30)
'Create section page number field with  and .
Dim sectionPageNumber As New PdfSectionPageNumberField(font,rect)
sectionPageNumber.NumberStyle = PdfNumberStyle.LowerRoman
'Draw the sectionPageNumber in section
For i As Integer = 0 To 1
Dim page As PdfPage = section.Pages.Add()
sectionPageNumber.Draw(page.Graphics)
Next i
'Save the document
document.Save("Output.pdf")
'Close the document
document.Close(True)
See Also

PdfSectionPageNumberField(PdfFont, PdfBrush)

Initializes a new instance of the PdfSectionPageNumberField class.

public PdfSectionPageNumberField(PdfFont font, PdfBrush brush)

Parameters

font PdfFont

The font.

brush PdfBrush

The brush.

Examples

//Create a new document.
PdfDocument document = new PdfDocument();
//Add the section.
PdfSection section = document.Sections.Add();
//Create a PDF font.
PdfFont font = new PdfStandardFont(PdfFontFamily.Helvetica, 12f);
//Create a PDF brush.
PdfBrush brush = PdfBrushes.Blue;
//Create section page number field.
PdfSectionPageNumberField sectionPageNumber = new PdfSectionPageNumberField(font,brush);
sectionPageNumber.NumberStyle = PdfNumberStyle.LowerRoman;
//Draw the sectionPageNumber in section.
for (int i = 0; i != 2; i++)
{
PdfPage page = section.Pages.Add();
sectionPageNumber.Draw(page.Graphics);
}
//Save the document.
document.Save("Output.pdf");
//Close the document.
document.Close(true);
'Create a new document.
Dim document As New PdfDocument()
'Add the section
Dim section As PdfSection = document.Sections.Add()
'Create a PDF font
Dim font As PdfFont = New PdfStandardFont(PdfFontFamily.Helvetica, 12.0F)
'Create a PDF brush.
Dim brush As PdfBrush = PdfBrushes.Blue
'Create a PDF  brush. 
'Create section page number field.
Dim sectionPageNumber As New PdfSectionPageNumberField(font,brush)
sectionPageNumber.NumberStyle = PdfNumberStyle.LowerRoman
'Draw the sectionPageNumber in section
For i As Integer = 0 To 1
Dim page As PdfPage = section.Pages.Add()
sectionPageNumber.Draw(page.Graphics)
Next i
'Save the document
document.Save("Output.pdf")
'Close the document
document.Close(True)
See Also

Methods

GetValue(PdfGraphics)

Gets the value of the field at the specified graphics.

protected override string GetValue(PdfGraphics graphics)

Parameters

graphics PdfGraphics

The graphics.

Returns

string

result

See Also

See Also