Class PdfXfaNumericField
Represents the numeric field of the XFA form.
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: Syncfusion.Pdf.Xfa
Assembly: Syncfusion.Pdf.Base.dll
Syntax
public class PdfXfaNumericField : PdfXfaStyledField
Examples
//Create a new PDF XFA document.
PdfXfaDocument document = new PdfXfaDocument();
//Add a new XFA page.
PdfXfaPage xfaPage = document.Pages.Add();
//Create a new PDF XFA form
PdfXfaForm mainForm = new PdfXfaForm("subform1", xfaPage, xfaPage.GetClientSize().Width);
//Create a numeric field and add the properties.
PdfXfaNumericField numericField = new PdfXfaNumericField("numericField", new SizeF(200, 20));
//Set the caption text.
numericField.Caption.Text = "Numeric Field";
//Add the field to the XFA form.
mainForm.Fields.Add(numericField);
//Add the XFA form to the document.
document.XfaForm = mainForm;
//Save the document.
document.Save("output.pdf", PdfXfaType.Dynamic);
//close the document
document.Close();
'Create a new PDF XFA document.
Dim document As New PdfXfaDocument()
'Add a new XFA page.
Dim xfaPage As PdfXfaPage = document.Pages.Add()
'Create a new PDF XFA form
Dim mainForm As New PdfXfaForm("subform1", xfaPage, xfaPage.GetClientSize().Width)
'Create a numeric field and add the properties.
Dim numericField As New PdfXfaNumericField("numericField", New SizeF(200,20))
'Set the caption text.
numericField.Caption.Text = "Numeric Field"
'Add the field to the XFA form.
mainForm.Fields.Add(numericField)
'Add the XFA form to the document.
document.XfaForm = mainForm
'Save the document.
document.Save("output.pdf",PdfXfaType.Dynamic)
'close the document
document.Close()
Constructors
PdfXfaNumericField(String, SizeF)
Initializes a new instance of the PdfXfaNumericField class.
Declaration
public PdfXfaNumericField(string name, SizeF size)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | Field name. |
System.Drawing.SizeF | size | Field size. |
Examples
//Create a new PDF XFA document.
PdfXfaDocument document = new PdfXfaDocument();
//Add a new XFA page.
PdfXfaPage xfaPage = document.Pages.Add();
//Create a new PDF XFA form
PdfXfaForm mainForm = new PdfXfaForm("subform1", xfaPage, xfaPage.GetClientSize().Width);
//Create a numeric field and add the properties.
PdfXfaNumericField numericField = new PdfXfaNumericField("numericField", new SizeF(200, 20));
//Set the caption text.
numericField.Caption.Text = "Numeric Field";
//Add the field to the XFA form.
mainForm.Fields.Add(numericField);
//Add the XFA form to the document.
document.XfaForm = mainForm;
//Save the document.
document.Save("output.pdf", PdfXfaType.Dynamic);
//close the document
document.Close();
'Create a new PDF XFA document.
Dim document As New PdfXfaDocument()
'Add a new XFA page.
Dim xfaPage As PdfXfaPage = document.Pages.Add()
'Create a new PDF XFA form
Dim mainForm As New PdfXfaForm("subform1", xfaPage, xfaPage.GetClientSize().Width)
'Create a numeric field and add the properties.
Dim numericField As New PdfXfaNumericField("numericField", New SizeF(200,20))
'Set the caption text.
numericField.Caption.Text = "Numeric Field"
'Add the field to the XFA form.
mainForm.Fields.Add(numericField)
'Add the XFA form to the document.
document.XfaForm = mainForm
'Save the document.
document.Save("output.pdf",PdfXfaType.Dynamic)
'close the document
document.Close()
PdfXfaNumericField(String, Single, Single)
Initializes a new instance of the PdfXfaNumericField class.
Declaration
public PdfXfaNumericField(string name, float width, float height)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | Field name. |
System.Single | width | Field width. |
System.Single | height | Field height. |
Examples
//Create a new PDF XFA document.
PdfXfaDocument document = new PdfXfaDocument();
//Add a new XFA page.
PdfXfaPage xfaPage = document.Pages.Add();
//Create a new PDF XFA form
PdfXfaForm mainForm = new PdfXfaForm("subform1", xfaPage, xfaPage.GetClientSize().Width);
//Create a numeric field and add the properties.
PdfXfaNumericField numericField = new PdfXfaNumericField("numericField", 200, 20);
//Set the caption text.
numericField.Caption.Text = "Numeric Field";
//Add the field to the XFA form.
mainForm.Fields.Add(numericField);
//Add the XFA form to the document.
document.XfaForm = mainForm;
//Save the document.
document.Save("output.pdf", PdfXfaType.Dynamic);
//close the document
document.Close();
'Create a new PDF XFA document.
Dim document As New PdfXfaDocument()
'Add a new XFA page.
Dim xfaPage As PdfXfaPage = document.Pages.Add()
'Create a new PDF XFA form
Dim mainForm As New PdfXfaForm("subform1", xfaPage, xfaPage.GetClientSize().Width)
'Create a numeric field and add the properties.
Dim numericField As New PdfXfaNumericField("numericField", 200,20)
'Set the caption text.
numericField.Caption.Text = "Numeric Field"
'Add the field to the XFA form.
mainForm.Fields.Add(numericField)
'Add the XFA form to the document.
document.XfaForm = mainForm
'Save the document.
document.Save("output.pdf",PdfXfaType.Dynamic)
'close the document
document.Close()
Properties
Caption
Gets or sets the caption of the field
Declaration
public PdfXfaCaption Caption { get; set; }
Property Value
Type | Description |
---|---|
PdfXfaCaption |
Examples
//Create a new PDF XFA document.
PdfXfaDocument document = new PdfXfaDocument();
//Add a new XFA page.
PdfXfaPage xfaPage = document.Pages.Add();
//Create a new PDF XFA form
PdfXfaForm mainForm = new PdfXfaForm("subform1", xfaPage, xfaPage.GetClientSize().Width);
//Create a numeric field and add the properties.
PdfXfaNumericField numericField = new PdfXfaNumericField("numericField", new SizeF(200, 20));
//Set the caption text.
numericField.Caption.Text = "Numeric Field";
//Add the field to the XFA form.
mainForm.Fields.Add(numericField);
//Add the XFA form to the document.
document.XfaForm = mainForm;
//Save the document.
document.Save("output.pdf", PdfXfaType.Dynamic);
//close the document
document.Close();
'Create a new PDF XFA document.
Dim document As New PdfXfaDocument()
'Add a new XFA page.
Dim xfaPage As PdfXfaPage = document.Pages.Add()
'Create a new PDF XFA form
Dim mainForm As New PdfXfaForm("subform1", xfaPage, xfaPage.GetClientSize().Width)
'Create a numeric field and add the properties.
Dim numericField As New PdfXfaNumericField("numericField", New SizeF(200,20))
'Set the caption text.
numericField.Caption.Text = "Numeric Field"
'Add the field to the XFA form.
mainForm.Fields.Add(numericField)
'Add the XFA form to the document.
document.XfaForm = mainForm
'Save the document.
document.Save("output.pdf",PdfXfaType.Dynamic)
'close the document
document.Close()
CombLength
Gets or sets the comb length
Declaration
public int CombLength { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 |
Examples
//Create a new PDF XFA document.
PdfXfaDocument document = new PdfXfaDocument();
//Add a new XFA page.
PdfXfaPage xfaPage = document.Pages.Add();
//Create a new PDF XFA form
PdfXfaForm mainForm = new PdfXfaForm("subform1", xfaPage, xfaPage.GetClientSize().Width);
//Create a numeric field and add the properties.
PdfXfaNumericField numericField = new PdfXfaNumericField("numericField", new SizeF(200, 20));
//Set the caption text.
numericField.Caption.Text = "Numeric Field";
//Set the comb lengh.
numericField.CombLengh = 5;
//Add the field to the XFA form.
mainForm.Fields.Add(numericField);
//Add the XFA form to the document.
document.XfaForm = mainForm;
//Save the document.
document.Save("output.pdf", PdfXfaType.Dynamic);
//close the document
document.Close();
'Create a new PDF XFA document.
Dim document As New PdfXfaDocument()
'Add a new XFA page.
Dim xfaPage As PdfXfaPage = document.Pages.Add()
'Create a new PDF XFA form
Dim mainForm As New PdfXfaForm("subform1", xfaPage, xfaPage.GetClientSize().Width)
'Create a numeric field and add the properties.
Dim numericField As New PdfXfaNumericField("numericField", New SizeF(200,20))
'Set the caption text.
numericField.Caption.Text = "Numeric Field"
'Set the comb length.
numericField.CombLength = 5
'Add the field to the XFA form.
mainForm.Fields.Add(numericField)
'Add the XFA form to the document.
document.XfaForm = mainForm
'Save the document.
document.Save("output.pdf",PdfXfaType.Dynamic)
'close the document
document.Close()
Culture
Gets or set the Culture.
Declaration
public string Culture { get; set; }
Property Value
Type | Description |
---|---|
System.String |
Examples
//Create a new PDF XFA document.
PdfXfaDocument document = new PdfXfaDocument();
//Add a new XFA page.
PdfXfaPage xfaPage = document.Pages.Add();
//Create a new PDF XFA form
PdfXfaForm mainForm = new PdfXfaForm("subform1", xfaPage, xfaPage.GetClientSize().Width);
//Create a numeric field and add the properties.
PdfXfaNumericField numericField = new PdfXfaNumericField("numericField", new SizeF(200, 20));
//Set culture.
numericField.Culture = "fr-FR";
//Set the caption text.
numericField.Caption.Text = "Numeric Field";
//Add the field to the XFA form.
mainForm.Fields.Add(numericField);
//Add the XFA form to the document.
document.XfaForm = mainForm;
//Save the document.
document.Save("output.pdf", PdfXfaType.Dynamic);
//close the document
document.Close();
'Create a new PDF XFA document.
Dim document As New PdfXfaDocument()
'Add a new XFA page.
Dim xfaPage As PdfXfaPage = document.Pages.Add()
'Create a new PDF XFA form
Dim mainForm As New PdfXfaForm("subform1", xfaPage, xfaPage.GetClientSize().Width)
'Create a numeric field and add the properties.
Dim numericField As New PdfXfaNumericField("numericField", New SizeF(200,20))
'Set culture.
numericField.Culture = "fr-FR"
'Set the caption text.
numericField.Caption.Text = "Numeric Field"
'Add the field to the XFA form.
mainForm.Fields.Add(numericField)
'Add the XFA form to the document.
document.XfaForm = mainForm
'Save the document.
document.Save("output.pdf",PdfXfaType.Dynamic)
'close the document
document.Close()
FieldType
Gets or sets the numeric field types
Declaration
public PdfXfaNumericType FieldType { get; set; }
Property Value
Type | Description |
---|---|
PdfXfaNumericType |
Examples
//Create a new PDF XFA document.
PdfXfaDocument document = new PdfXfaDocument();
//Add a new XFA page.
PdfXfaPage xfaPage = document.Pages.Add();
//Create a new PDF XFA form
PdfXfaForm mainForm = new PdfXfaForm("subform1", xfaPage, xfaPage.GetClientSize().Width);
//Create a numeric field and add the properties.
PdfXfaNumericField numericField = new PdfXfaNumericField("numericField", new SizeF(200, 20));
//Set the caption text.
numericField.Caption.Text = "Numeric Field";
//Set field type.
numericField.FieldType = PdfXfaNumericType.Integer;
//Add the field to the XFA form.
mainForm.Fields.Add(numericField);
//Add the XFA form to the document.
document.XfaForm = mainForm;
//Save the document.
document.Save("output.pdf", PdfXfaType.Dynamic);
//close the document
document.Close();
'Create a new PDF XFA document.
Dim document As New PdfXfaDocument()
'Add a new XFA page.
Dim xfaPage As PdfXfaPage = document.Pages.Add()
'Create a new PDF XFA form
Dim mainForm As New PdfXfaForm("subform1", xfaPage, xfaPage.GetClientSize().Width)
'Create a numeric field and add the properties.
Dim numericField As New PdfXfaNumericField("numericField", New SizeF(200,20))
'Set the caption text.
numericField.Caption.Text = "Numeric Field"
'Set field type.
numericField.FieldType = PdfXfaNumericType.Integer
'Add the field to the XFA form.
mainForm.Fields.Add(numericField)
'Add the XFA form to the document.
document.XfaForm = mainForm
'Save the document.
document.Save("output.pdf",PdfXfaType.Dynamic)
'close the document
document.Close()
NumericValue
Gets or sets the numeric field value
Declaration
public double NumericValue { get; set; }
Property Value
Type | Description |
---|---|
System.Double |
Examples
//Create a new PDF XFA document.
PdfXfaDocument document = new PdfXfaDocument();
//Add a new XFA page.
PdfXfaPage xfaPage = document.Pages.Add();
//Create a new PDF XFA form
PdfXfaForm mainForm = new PdfXfaForm("subform1", xfaPage, xfaPage.GetClientSize().Width);
//Create a numeric field and add the properties.
PdfXfaNumericField numericField = new PdfXfaNumericField("numericField", new SizeF(200, 20));
//Set the caption text.
numericField.Caption.Text = "Numeric Field";
//Set the value.
numericField.Value = 12345;
//Add the field to the XFA form.
mainForm.Fields.Add(numericField);
//Add the XFA form to the document.
document.XfaForm = mainForm;
//Save the document.
document.Save("output.pdf", PdfXfaType.Dynamic);
//close the document
document.Close();
'Create a new PDF XFA document.
Dim document As New PdfXfaDocument()
'Add a new XFA page.
Dim xfaPage As PdfXfaPage = document.Pages.Add()
'Create a new PDF XFA form
Dim mainForm As New PdfXfaForm("subform1", xfaPage, xfaPage.GetClientSize().Width)
'Create a numeric field and add the properties.
Dim numericField As New PdfXfaNumericField("numericField", New SizeF(200,20))
'Set the caption text.
numericField.Caption.Text = "Numeric Field"
'Set the value.
numericField.Value = 12345;
'Add the field to the XFA form.
mainForm.Fields.Add(numericField)
'Add the XFA form to the document.
document.XfaForm = mainForm
'Save the document.
document.Save("output.pdf",PdfXfaType.Dynamic)
'close the document
document.Close()
Padding
Gets or sets the padding of the field
Declaration
public PdfPaddings Padding { get; set; }
Property Value
Type | Description |
---|---|
PdfPaddings |
Examples
//Create a new PDF XFA document.
PdfXfaDocument document = new PdfXfaDocument();
//Add a new XFA page.
PdfXfaPage xfaPage = document.Pages.Add();
//Create a new PDF XFA form
PdfXfaForm mainForm = new PdfXfaForm("subform1", xfaPage, xfaPage.GetClientSize().Width);
//Create a numeric field and add the properties.
PdfXfaNumericField numericField = new PdfXfaNumericField("numericField", new SizeF(200, 20));
//Set padding.
numericField.Padding.All = 2;
//Set the caption text.
numericField.Caption.Text = "Numeric Field";
//Add the field to the XFA form.
mainForm.Fields.Add(numericField);
//Add the XFA form to the document.
document.XfaForm = mainForm;
//Save the document.
document.Save("output.pdf", PdfXfaType.Dynamic);
//close the document
document.Close();
'Create a new PDF XFA document.
Dim document As New PdfXfaDocument()
'Add a new XFA page.
Dim xfaPage As PdfXfaPage = document.Pages.Add()
'Create a new PDF XFA form
Dim mainForm As New PdfXfaForm("subform1", xfaPage, xfaPage.GetClientSize().Width)
'Create a numeric field and add the properties.
Dim numericField As New PdfXfaNumericField("numericField", New SizeF(200,20))
'Set padding.
numericField.Padding = 2
'Set the caption text.
numericField.Caption.Text = "Numeric Field"
'Add the field to the XFA form.
mainForm.Fields.Add(numericField)
'Add the XFA form to the document.
document.XfaForm = mainForm
'Save the document.
document.Save("output.pdf",PdfXfaType.Dynamic)
'close the document
document.Close()
PatternString
Gets or sets the pattern string
Declaration
public string PatternString { get; set; }
Property Value
Type | Description |
---|---|
System.String |
Examples
//Create a new PDF XFA document.
PdfXfaDocument document = new PdfXfaDocument();
//Add new XFA page
PdfXfaPage xfaPage = document.Pages.Add();
//Create a new PDF XFA form with horizontal flow direction
PdfXfaForm mainForm = new PdfXfaForm(xfaPage, PdfXfaFlowDirection.Horizontal, xfaPage.GetClientSize().Width);
//Create a numeric field and add the properties.
PdfXfaNumericField numericField = new PdfXfaNumericField("numericField", new SizeF(200, 20));
//Set the caption text.
numericField.Caption.Text = "Numeric Field";
//Set the pattern string
numericField.PatternString = "zzzzzzzzz9";
//Add the field to the XFA form.
mainForm.Fields.Add(numericField);
//Add the XFA form to the document.
document.XfaForm = mainForm;
//Save the document.
document.Save("XfaForm.pdf", PdfXfaType.Dynamic);
//close the document
document.Close();
'Create a new PDF XFA document.
Dim document As New PdfXfaDocument()
'Add new XFA page
Dim xfaPage As PdfXfaPage = document.Pages.Add()
'Create a new PDF XFA form with horizontal flow direction
Dim mainForm As New PdfXfaForm(xfaPage, PdfXfaFlowDirection.Horizontal, xfaPage.GetClientSize().Width)
'Create a numeric field and add the properties.
Dim numericField As New PdfXfaNumericField("numericField", New SizeF(200, 20))
'Set the caption text.
numericField.Caption.Text = "Numeric Field"
'Set the pattern string
numericField.PatternString = "zzzzzzzzz9"
'Add the field to the XFA form.
mainForm.Fields.Add(numericField)
'Add the XFA form to the document.
document.XfaForm = mainForm
'Save the document.
document.Save("XfaForm.pdf", PdfXfaType.Dynamic)
'close the document
document.Close()
Methods
Clone()
Creates a new object that is a copy of the current instance.
Declaration
public object Clone()
Returns
Type | Description |
---|---|
System.Object | The copy of the new object for this instance. |
Examples
//Create a new PDF XFA document.
PdfXfaDocument document = new PdfXfaDocument();
//Add a new XFA page.
PdfXfaPage xfaPage = document.Pages.Add();
//Create a new PDF XFA form
PdfXfaForm mainForm = new PdfXfaForm("subform1", xfaPage, xfaPage.GetClientSize().Width);
//Create a numeric field and add the properties.
PdfXfaNumericField numericField = new PdfXfaNumericField("numericField", new SizeF(200, 20));
//Set the caption text.
numericField.Caption.Text = "Numeric Field";
//Add the field to the XFA form.
mainForm.Fields.Add(numericField);
//Clone the numeric field.
mainForm.Fields.Add(numericField.Clone() as PdfXfaNumericField);
//Add the XFA form to the document.
document.XfaForm = mainForm;
//Save the document.
document.Save("output.pdf", PdfXfaType.Dynamic);
//close the document
document.Close();
'Create a new PDF XFA document.
Dim document As New PdfXfaDocument()
'Add a new XFA page.
Dim xfaPage As PdfXfaPage = document.Pages.Add()
'Create a new PDF XFA form
Dim mainForm As New PdfXfaForm("subform1", xfaPage, xfaPage.GetClientSize().Width)
'Create a numeric field and add the properties.
Dim numericField As New PdfXfaNumericField("numericField", New SizeF(200,20))
'Set the caption text.
numericField.Caption.Text = "Numeric Field"
'Add the field to the XFA form.
mainForm.Fields.Add(numericField)
//Clone the numeric field.
mainForm.Fields.Add(TryCast(numericField.Clone(), PdfXfaNumericField)
'Add the XFA form to the document.
document.XfaForm = mainForm
'Save the document.
document.Save("output.pdf",PdfXfaType.Dynamic)
'close the document
document.Close()