Xamarin.Forms

  • Code Examples
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Class PdfSingleValueField

    Show / Hide Table of Contents

    Class PdfSingleValueField

    Represents automatic field which has the same value in the whole document.

    Inheritance
    System.Object
    PdfGraphicsElement
    PdfAutomaticField
    PdfDynamicField
    PdfSingleValueField
    PdfCreationDateField
    PdfDocumentAuthorField
    PdfPageCountField
    Inherited Members
    PdfAutomaticField.Bounds
    PdfAutomaticField.Size
    PdfAutomaticField.Location
    PdfAutomaticField.Font
    PdfAutomaticField.Brush
    PdfAutomaticField.Pen
    PdfAutomaticField.StringFormat
    PdfGraphicsElement.Draw(PdfGraphics)
    PdfGraphicsElement.Draw(PdfGraphics, PointF)
    PdfGraphicsElement.Draw(PdfGraphics, Single, Single)
    Namespace: Syncfusion.Pdf
    Assembly: Syncfusion.Pdf.Portable.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, 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.

    RectangleF bounds

    The bounds.

    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.

    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.

    PointF location

    The location.

    System.Single scalingX

    The scaling X.

    System.Single scalingY

    The scaling Y.

    Overrides
    Syncfusion.Pdf.PdfAutomaticField.PerformDraw(Syncfusion.Pdf.Graphics.PdfGraphics, Syncfusion.Drawing.PointF, System.Single, System.Single)

    See Also

    PdfDynamicField
    Back to top Generated by DocFX
    Copyright © 2001 - 2023 Syncfusion Inc. All Rights Reserved