Class PdfSingleValueField
- Namespace
- Syncfusion.Pdf
- Assembly
- Syncfusion.Pdf.Portable.dll
Represents automatic field which has the same value in the whole document.
public abstract class PdfSingleValueField : PdfDynamicField
- Inheritance
-
PdfSingleValueField
- Derived
- Inherited Members
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.
public PdfSingleValueField()
- See Also
PdfSingleValueField(PdfFont)
Initializes a new instance of the PdfSingleValueField class with PdfFont.
public PdfSingleValueField(PdfFont font)
Parameters
font
PdfFontA PdfFont object that specifies the font attributes (the family name, the size, and the style of the font) to use.
- See Also
PdfSingleValueField(PdfFont, RectangleF)
Initializes a new instance of the PdfSingleValueField class with PdfFont and rectangle bounds of the field
public PdfSingleValueField(PdfFont font, RectangleF bounds)
Parameters
font
PdfFontA PdfFont object that specifies the font attributes (the family name, the size, and the style of the font) to use.
bounds
RectangleFThe bounds.
- See Also
PdfSingleValueField(PdfFont, PdfBrush)
Initializes a new instance of the PdfSingleValueField class with PdfFont and PdfBrush.
public PdfSingleValueField(PdfFont font, PdfBrush brush)
Parameters
font
PdfFontA PdfFont object that specifies the font attributes (the family name, the size, and the style of the font) to use.
brush
PdfBrushA PdfBrush object that is used to fill the string.
- See Also
Methods
PerformDraw(PdfGraphics, PointF, float, float)
Performs draw.
protected override void PerformDraw(PdfGraphics graphics, PointF location, float scalingX, float scalingY)
Parameters
graphics
PdfGraphicsThe graphics.
location
PointFThe location.
scalingX
floatThe scaling X.
scalingY
floatThe scaling Y.
- See Also