PdfSingleValueField Class
Represents automatic field which has the same value in the whole document.
Inheritance
Inherited Members
Namespace: Syncfusion.Pdf
Assembly: Syncfusion.Pdf.Base.dll
Syntax
public abstract class PdfSingleValueField : PdfDynamicField
Examples
//Create a new document.
PdfDocument doc = new PdfDocument();
//Create new PDF font.
PdfFont font = new PdfStandardFont(PdfFontFamily.Helvetica, 12f);
//Create new PDF brush.
PdfBrush brush = PdfBrushes.Black;
//Creates page count field.
PdfPageCountField pageCount = new PdfPageCountField(font);
pageCount.NumberStyle = PdfNumberStyle.Numeric;
for (int i = 0; i != 2; i++)
{
PdfPage page = doc.Pages.Add();
pageCount.Draw(page.Graphics);
}
//Save and close the document.
doc.Save("PageCountField.pdf");
doc.Close(true);
'Create a new document.
Dim doc As PdfDocument = New PdfDocument()
Dim font As PdfFont = New PdfStandardFont(PdfFontFamily.Helvetica, 12f)
Dim brush As PdfBrush = PdfBrushes.Black
'Creates page count field.
Dim pageCount As PdfPageCountField = New PdfPageCountField(font)
pageCount.NumberStyle = PdfNumberStyle.Numeric
For i As Integer = 0 To 1
Dim page As PdfPage = doc.Pages.Add()
pageCount.Draw(page.Graphics)
Next i
'Save and close the document.
doc.Save("PageCountField.pdf")
doc.Close(True);
Constructors
PdfSingleValueField()
Initializes a new instance of the PdfSingleValueField class.
Declaration
public PdfSingleValueField()
PdfSingleValueField(PdfFont)
Initializes a new instance of the PdfSingleValueField class with PdfFont.
Declaration
public PdfSingleValueField(PdfFont font)
Parameters
Type | Name | Description |
---|---|---|
PdfFont | font | A PdfFont object that specifies the font attributes (the family name, the size, and the style of the font) to use. |
PdfSingleValueField(PdfFont, PdfBrush)
Initializes a new instance of the PdfSingleValueField class with PdfFont and PdfBrush.
Declaration
public PdfSingleValueField(PdfFont font, PdfBrush brush)
Parameters
Type | Name | Description |
---|---|---|
PdfFont | font | A PdfFont object that specifies the font attributes (the family name, the size, and the style of the font) to use. |
PdfBrush | brush | A PdfBrush object that is used to fill the string. |
PdfSingleValueField(PdfFont, RectangleF)
Initializes a new instance of the PdfSingleValueField class with PdfFont and rectangle bounds of the field
Declaration
public PdfSingleValueField(PdfFont font, RectangleF bounds)
Parameters
Type | Name | Description |
---|---|---|
PdfFont | font | A PdfFont object that specifies the font attributes (the family name, the size, and the style of the font) to use. |
System.Drawing.RectangleF | bounds | The bounds. |
Methods
PerformDraw(PdfGraphics, PointF, Single, Single)
Performs draw.
Declaration
protected override void PerformDraw(PdfGraphics graphics, PointF location, float scalingX, float scalingY)
Parameters
Type | Name | Description |
---|---|---|
PdfGraphics | graphics | The graphics. |
System.Drawing.PointF | location | The location. |
System.Single | scalingX | The scaling X. |
System.Single | scalingY | The scaling Y. |