Class PdfSectionPageCountField
Represents an automatic field to display number of pages in section.
Inheritance
System.Object
PdfSectionPageCountField
Inherited Members
Namespace: Syncfusion.Pdf
Assembly: Syncfusion.Pdf.Portable.dll
Syntax
public class PdfSectionPageCountField : 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 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.
Declaration
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 .
Declaration
public PdfSectionPageCountField(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 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 RectangleF .
Declaration
public PdfSectionPageCountField(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 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)
PdfSectionPageCountField(PdfFont, PdfBrush)
Initializes a new instance of the PdfSectionPageCountField class with PdfFont and PdfBrush .
Declaration
public PdfSectionPageCountField(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 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)
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)