Class PdfSectionPageNumberField
Represents an automatic field to display page number within a section.
Inheritance
System.Object
PdfSectionPageNumberField
Inherited Members
Namespace: Syncfusion.Pdf
Assembly: Syncfusion.Pdf.NET.dll
Syntax
public class PdfSectionPageNumberField : PdfMultipleNumberValueField
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.
Declaration
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)
PdfSectionPageNumberField(PdfFont)
Initializes a new instance of the PdfSectionPageNumberField class.
Declaration
public PdfSectionPageNumberField(PdfFont font)
Parameters
Type | Name | Description |
---|---|---|
PdfFont | font | 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)
PdfSectionPageNumberField(PdfFont, RectangleF)
Initializes a new instance of the PdfSectionPageNumberField class.
Declaration
public PdfSectionPageNumberField(PdfFont font, RectangleF bounds)
Parameters
Type | Name | Description |
---|---|---|
PdfFont | font | The font. |
RectangleF | bounds | 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 PdfFont and RectangleF
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 PdfFont and RectangleF.
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)
PdfSectionPageNumberField(PdfFont, PdfBrush)
Initializes a new instance of the PdfSectionPageNumberField class.
Declaration
public PdfSectionPageNumberField(PdfFont font, PdfBrush brush)
Parameters
Type | Name | Description |
---|---|---|
PdfFont | font | The font. |
PdfBrush | brush | 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)
Methods
GetValue(PdfGraphics)
Gets the value of the field at the specified graphics.
Declaration
protected override string GetValue(PdfGraphics graphics)
Parameters
Type | Name | Description |
---|---|---|
PdfGraphics | graphics | The graphics. |
Returns
Type | Description |
---|---|
System.String | result |
Overrides
Syncfusion.Pdf.PdfAutomaticField.GetValue(Syncfusion.Pdf.Graphics.PdfGraphics)