Table of Contents

Class PdfSectionPageCountField

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

Represents an automatic field to display number of pages in section.

public class PdfSectionPageCountField : PdfMultipleNumberValueField
Inheritance
PdfSectionPageCountField
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 count field.
PdfSectionPageCountField sectionPageCount = new PdfSectionPageCountField(font);
sectionPageCount.NumberStyle = PdfNumberStyle.UpperLatin;
//Draw the sectionPageCount in each page of a section.
for (int i = 0; i != 2; i++)
{
PdfPage page = section.Pages.Add();
sectionPageCount.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, 12f)
'Create section page count field.
Dim sectionPageCount As New PdfSectionPageCountField(font)
sectionPageCount.NumberStyle = PdfNumberStyle.UpperLatin
'Draw the sectionPageCount each page in a section.
For i As Integer = 0 To 1
Dim page As PdfPage = section.Pages.Add()
sectionPageCount.Draw(page.Graphics)
Next i
'Save the document.
document.Save("Output.pdf")
'Close the document.
document.Close(True)

Constructors

PdfSectionPageCountField()

Initializes a new instance of the PdfSectionPageCountField class.

public PdfSectionPageCountField()

Examples

//Create a new document.
PdfDocument document = new PdfDocument();
//Add the section.
PdfSection section = document.Sections.Add();
//Create section page count field.
PdfSectionPageCountField sectionPageCount = new PdfSectionPageCountField();
sectionPageCount.NumberStyle = PdfNumberStyle.UpperLatin;
//Draw the sectionPageCount in each page of a section.
for (int i = 0; i != 2; i++)
{
PdfPage page = section.Pages.Add();
sectionPageCount.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 count field.
Dim sectionPageCount As New PdfSectionPageCountField()
sectionPageCount.NumberStyle = PdfNumberStyle.UpperLatin
'Draw the sectionPageCount each page in a section.
For i As Integer = 0 To 1
Dim page As PdfPage = section.Pages.Add()
sectionPageCount.Draw(page.Graphics)
Next i
'Save the document.
document.Save("Output.pdf")
'Close the document.
document.Close(True)
See Also

PdfSectionPageCountField(PdfFont)

Initializes a new instance of the PdfSectionPageCountField class with PdfFont .

public PdfSectionPageCountField(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 count field.
PdfSectionPageCountField sectionPageCount = new PdfSectionPageCountField(font);
sectionPageCount.NumberStyle = PdfNumberStyle.UpperLatin;
//Draw the sectionPageCount in each page of a section.
for (int i = 0; i != 2; i++)
{
PdfPage page = section.Pages.Add();
sectionPageCount.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, 12f)
'Create section page count field.
Dim sectionPageCount As New PdfSectionPageCountField(font)
sectionPageCount.NumberStyle = PdfNumberStyle.UpperLatin
'Draw the sectionPageCount each page in a section.
For i As Integer = 0 To 1
Dim page As PdfPage = section.Pages.Add()
sectionPageCount.Draw(page.Graphics)
Next i
'Save the document.
document.Save("Output.pdf")
'Close the document.
document.Close(True)
See Also

PdfSectionPageCountField(PdfFont, RectangleF)

Initializes a new instance of the PdfSectionPageCountField class with PdfFont and Syncfusion.Drawing.RectangleF .

public PdfSectionPageCountField(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 a PDF brush.

//Create section page count field.
PdfSectionPageCountField sectionPageCount = new PdfSectionPageCountField(font,rect);
sectionPageCount.NumberStyle = PdfNumberStyle.UpperLatin;
//Draw the sectionPageCount in each page of a section.
for (int i = 0; i != 2; i++)
{
PdfPage page = section.Pages.Add();
sectionPageCount.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, 12f)
Dim rect As RectangleF = New RectangleF(10, 10, 30, 30)
'Create section page count field.
Dim sectionPageCount As PdfSectionPageCountField = New PdfSectionPageCountField(font, rect)
sectionPageCount.NumberStyle = PdfNumberStyle.UpperLatin
'Draw the sectionPageCount each page in a section.
For i As Integer = 0 To 1
Dim page As PdfPage = section.Pages.Add()
sectionPageCount.Draw(page.Graphics)
Next i
'Save the document.
document.Save("Output.pdf")
'Close the document.
document.Close(True)
See Also

PdfSectionPageCountField(PdfFont, PdfBrush)

Initializes a new instance of the PdfSectionPageCountField class with PdfFont and PdfBrush .

public PdfSectionPageCountField(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 count field.
PdfSectionPageCountField sectionPageCount = new PdfSectionPageCountField(font,brush);
sectionPageCount.NumberStyle = PdfNumberStyle.UpperLatin;
//Draw the sectionPageCount in each page of a section.
for (int i = 0; i != 2; i++)
{
PdfPage page = section.Pages.Add();
sectionPageCount.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, 12f)
'Create a PDF brush.
Dim brush As PdfBrush = PdfBrushes.Blue
'Create a PDF  brush.
Dim sectionPageCount As PdfSectionPageCountField = New PdfSectionPageCountField(font, brush)
'Create section page count field.
Dim sectionPageCount As New PdfSectionPageCountField(font)
sectionPageCount.NumberStyle = PdfNumberStyle.UpperLatin
'Draw the sectionPageCount each page in a section.
For i As Integer = 0 To 1
Dim page As PdfPage = section.Pages.Add()
sectionPageCount.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