Class PdfLoadedStyledField
Represents loaded styled field.
Inheritance
Implements
Inherited Members
Namespace: Syncfusion.Pdf.Parsing
Assembly: Syncfusion.Pdf.NET.dll
Syntax
public class PdfLoadedStyledField : PdfLoadedField, IPdfWrapper, INotifyPropertyChanged
Examples
//Load an existing document
PdfLoadedDocument doc = new PdfLoadedDocument("Form.pdf");
// Load the text box field
PdfLoadedTextBoxField ldField = doc.Form.Fields[0] as PdfLoadedTextBoxField;
//Reset fields bounds.
ldField.Bounds = new RectangleF(100, 300, 100, 30);
//Save and close the PDF document.
doc.Save("output.pdf");
doc.Close(true);
'Load an existing document
Dim doc As New PdfLoadedDocument("Form.pdf")
' Load the text box field
Dim ldField As PdfLoadedTextBoxField = TryCast(doc.Form.Fields(0), PdfLoadedTextBoxField)
'Reset fields bounds.
ldField.Bounds = New RectangleF(100, 300, 100, 30)
'Save and close the PDF document.
doc.Save("output.pdf")
doc.Close(True)
Properties
BorderColor
Gets or sets the color of the border.
Declaration
public PdfColor BorderColor { get; set; }
Property Value
Type | Description |
---|---|
PdfColor | The color of the border. |
Examples
//Load an existing document
PdfLoadedDocument doc = new PdfLoadedDocument("Form.pdf");
// Load the text box field
PdfLoadedTextBoxField ldField = doc.Form.Fields[0] as PdfLoadedTextBoxField;
//Set border width.
ldField.BorderWidth = 1;
//Set border color.
ldField.BorderColor = Color.Red;
//Set border style.
ldField.BorderStyle = PdfBorderStyle.Dashed;
doc.Form.SetDefaultAppearance(false);
//Save and close the PDF document.
doc.Save("output.pdf");
doc.Close(true);
'Load an existing document
Dim doc As New PdfLoadedDocument("Form.pdf")
' Load the text box field
Dim ldField As PdfLoadedTextBoxField = TryCast(doc.Form.Fields(0), PdfLoadedTextBoxField)
'Set border width.
ldField.BorderWidth = 1
'Set border color.
ldField.BorderColor = Color.Red
'Set border style.
ldField.BorderStyle = PdfBorderStyle.Dashed
doc.Form.SetDefaultAppearance(False)
'Save and close the PDF document.
doc.Save("output.pdf")
doc.Close(True)
BorderStyle
Gets or sets the style of the border.
Declaration
public PdfBorderStyle BorderStyle { get; set; }
Property Value
Type | Description |
---|---|
PdfBorderStyle | The color of the border. |
Examples
//Load an existing document
PdfLoadedDocument doc = new PdfLoadedDocument("Form.pdf");
// Load the text box field
PdfLoadedTextBoxField ldField = doc.Form.Fields[0] as PdfLoadedTextBoxField;
//Set border width.
ldField.BorderWidth = 1;
//Set border color.
ldField.BorderColor = Color.Red;
//Set border style.
ldField.BorderStyle = PdfBorderStyle.Dashed;
doc.Form.SetDefaultAppearance(false);
//Save and close the PDF document.
doc.Save("output.pdf");
doc.Close(true);
'Load an existing document
Dim doc As New PdfLoadedDocument("Form.pdf")
' Load the text box field
Dim ldField As PdfLoadedTextBoxField = TryCast(doc.Form.Fields(0), PdfLoadedTextBoxField)
'Set border width.
ldField.BorderWidth = 1
'Set border color.
ldField.BorderColor = Color.Red
'Set border style.
ldField.BorderStyle = PdfBorderStyle.Dashed
doc.Form.SetDefaultAppearance(False)
'Save and close the PDF document.
doc.Save("output.pdf")
doc.Close(True)
BorderWidth
Gets or Sets the width of the border.
Declaration
public float BorderWidth { get; set; }
Property Value
Type | Description |
---|---|
System.Single | The width of the border. |
Examples
//Load an existing document
PdfLoadedDocument doc = new PdfLoadedDocument("Form.pdf");
// Load the text box field
PdfLoadedTextBoxField ldField = doc.Form.Fields[0] as PdfLoadedTextBoxField;
//Set border width.
ldField.BorderWidth = 1;
//Set border color.
ldField.BorderColor = Color.Red;
//Set border style.
ldField.BorderStyle = PdfBorderStyle.Dashed;
doc.Form.SetDefaultAppearance(false);
//Save and close the PDF document.
doc.Save("output.pdf");
doc.Close(true);
'Load an existing document
Dim doc As New PdfLoadedDocument("Form.pdf")
' Load the text box field
Dim ldField As PdfLoadedTextBoxField = TryCast(doc.Form.Fields(0), PdfLoadedTextBoxField)
'Set border width.
ldField.BorderWidth = 1
'Set border color.
ldField.BorderColor = Color.Red
'Set border style.
ldField.BorderStyle = PdfBorderStyle.Dashed
doc.Form.SetDefaultAppearance(False)
'Save and close the PDF document.
doc.Save("output.pdf")
doc.Close(True)
Bounds
Gets or sets the bounds.
Declaration
public RectangleF Bounds { get; set; }
Property Value
Type |
---|
RectangleF |
Examples
//Load an existing document
PdfLoadedDocument doc = new PdfLoadedDocument("Form.pdf");
// Load the text box field
PdfLoadedTextBoxField ldField = doc.Form.Fields[0] as PdfLoadedTextBoxField;
//Reset fields bounds.
ldField.Bounds = new RectangleF(100, 300, 100, 30);
//Save and close the PDF document.
doc.Save("output.pdf");
doc.Close(true);
'Load an existing document
Dim doc As New PdfLoadedDocument("Form.pdf")
' Load the text box field
Dim ldField As PdfLoadedTextBoxField = TryCast(doc.Form.Fields(0), PdfLoadedTextBoxField)
'Reset fields bounds.
ldField.Bounds = New RectangleF(100, 300, 100, 30)
'Save and close the PDF document.
doc.Save("output.pdf")
doc.Close(True)
DefaultIndex
Gets or set the default index.
Declaration
public int DefaultIndex { get; set; }
Property Value
Type |
---|
System.Int32 |
Examples
//Load an existing document
PdfLoadedDocument doc = new PdfLoadedDocument("Form.pdf");
// Load the text box field
PdfLoadedTextBoxField ldField = doc.Form.Fields[0] as PdfLoadedTextBoxField;
//Set default index.
ldField.DefaultIndex = 2;
//Save and close the PDF document.
doc.Save("output.pdf");
doc.Close(true);
'Load an existing document
Dim doc As New PdfLoadedDocument("Form.pdf")
' Load the text box field
Dim ldField As PdfLoadedTextBoxField = TryCast(doc.Form.Fields(0), PdfLoadedTextBoxField)
'Set default index.
ldField.DefaultIndex = 2
'Save and close the PDF document.
doc.Save("output.pdf")
doc.Close(True)
Font
Gets or set the font.
Declaration
public PdfFont Font { get; set; }
Property Value
Type | Description |
---|---|
PdfFont | The font. |
Examples
//Load an existing document
PdfLoadedDocument doc = new PdfLoadedDocument("Form.pdf");
// Load the text box field
PdfLoadedTextBoxField ldField = doc.Form.Fields[0] as PdfLoadedTextBoxField;
//Set font.
ldField.Font = new PdfStandardFont(PdfFontFamily.TimesRoman, 12, PdfFontStyle.Italic);
doc.Form.SetDefaultAppearance(false);
//Save and close the PDF document.
doc.Save("output.pdf");
doc.Close(true);
'Load an existing document
Dim doc As New PdfLoadedDocument("Form.pdf")
' Load the text box field
Dim ldField As PdfLoadedTextBoxField = TryCast(doc.Form.Fields(0), PdfLoadedTextBoxField)
'Set font.
ldField.Font = New PdfStandardFont(PdfFontFamily.TimesRoman, 12, PdfFontStyle.Italic)
doc.Form.SetDefaultAppearance(False)
'Save and close the PDF document.
doc.Save("output.pdf")
doc.Close(True)
GotFocus
Gets or sets the action to be performed when the annotation receives the input focus.
Declaration
public PdfAction GotFocus { get; set; }
Property Value
Type | Description |
---|---|
PdfAction | The got focus action. |
Examples
//Load an existing document
PdfLoadedDocument doc = new PdfLoadedDocument("Form.pdf");
// Load the text box field
PdfLoadedTextBoxField ldField = doc.Form.Fields[0] as PdfLoadedTextBoxField;
//Reset fields bounds.
ldField.Bounds = new RectangleF(100, 300, 100, 30);
//Create a new PDF java script action instance.
PdfJavaScriptAction action = new PdfJavaScriptAction("getField(\"fn\").value=\"Field Focused\";");
//Set the event.
ldField.GotFocus = action;
//Save and close the PDF document.
doc.Save("output.pdf");
doc.Close(true);
'Load an existing document
Dim doc As New PdfLoadedDocument("Form.pdf")
' Load the text box field
Dim ldField As PdfLoadedTextBoxField = TryCast(doc.Form.Fields(0), PdfLoadedTextBoxField)
'Reset fields bounds.
ldField.Bounds = New RectangleF(100, 300, 100, 30)
'Create a new PDF java script action instance.
Dim action As New PdfJavaScriptAction("getField(""fn"").value=""Field Focused"";")
'Set the event.
ldField.GotFocus = action
'Save and close the PDF document.
doc.Save("output.pdf")
doc.Close(True)
Location
Gets or sets the location.
Declaration
public PointF Location { get; set; }
Property Value
Type |
---|
PointF |
Examples
//Load an existing document
PdfLoadedDocument doc = new PdfLoadedDocument("Form.pdf");
// Load the text box field
PdfLoadedTextBoxField ldField = doc.Form.Fields[0] as PdfLoadedTextBoxField;
//Reset fields location.
ldField.Location = new PointF(100, 300);
//Save and close the PDF document.
doc.Save("output.pdf");
doc.Close(true);
'Load an existing document
Dim doc As New PdfLoadedDocument("Form.pdf")
' Load the text box field
Dim ldField As PdfLoadedTextBoxField = TryCast(doc.Form.Fields(0), PdfLoadedTextBoxField)
'Reset fields location.
ldField.Location = New PointF(100, 300)
'Save and close the PDF document.
doc.Save("output.pdf")
doc.Close(True)
LostFocus
Gets or sets the action to be performed when the annotation loses the input focus.
Declaration
public PdfAction LostFocus { get; set; }
Property Value
Type | Description |
---|---|
PdfAction | The lost focus action. |
Examples
//Load an existing document
PdfLoadedDocument doc = new PdfLoadedDocument("Form.pdf");
// Load the text box field
PdfLoadedTextBoxField ldField = doc.Form.Fields[0] as PdfLoadedTextBoxField;
//Reset fields bounds.
ldField.Bounds = new RectangleF(100, 300, 100, 30);
//Create a new PDF java script action instance.
PdfJavaScriptAction action = new PdfJavaScriptAction("getField(\"fn\").value=\"Lost Focus\";");
//Set the event.
ldField.LostFocus = action;
//Save and close the PDF document.
doc.Save("output.pdf");
doc.Close(true);
'Load an existing document
Dim doc As New PdfLoadedDocument("Form.pdf")
' Load the text box field
Dim ldField As PdfLoadedTextBoxField = TryCast(doc.Form.Fields(0), PdfLoadedTextBoxField)
'Reset fields bounds.
ldField.Bounds = New RectangleF(100, 300, 100, 30)
'Create a new PDF java script action instance.
Dim action As New PdfJavaScriptAction("getField(""fn"").value=""Lost Focus"";")
'Set the event.
ldField.LostFocus = action
'Save and close the PDF document.
doc.Save("output.pdf")
doc.Close(True)
MouseDown
Gets or sets the action to be performed when the mouse button is pressed inside the annotation's active area.
Declaration
public PdfAction MouseDown { get; set; }
Property Value
Type | Description |
---|---|
PdfAction | The mouse down action. |
Examples
//Load an existing document
PdfLoadedDocument doc = new PdfLoadedDocument("Form.pdf");
// Load the text box field
PdfLoadedTextBoxField ldField = doc.Form.Fields[0] as PdfLoadedTextBoxField;
//Reset fields bounds.
ldField.Bounds = new RectangleF(100, 300, 100, 30);
//Create a new PDF java script action instance.
PdfJavaScriptAction action = new PdfJavaScriptAction("getField(\"fn\").value=\"Mouse Down\";");
//Set the event.
ldField.MouseDown = action;
//Save and close the PDF document.
doc.Save("output.pdf");
doc.Close(true);
'Load an existing document
Dim doc As New PdfLoadedDocument("Form.pdf")
' Load the text box field
Dim ldField As PdfLoadedTextBoxField = TryCast(doc.Form.Fields(0), PdfLoadedTextBoxField)
'Reset fields bounds.
ldField.Bounds = New RectangleF(100, 300, 100, 30)
'Create a new PDF java script action instance.
Dim action As New PdfJavaScriptAction("getField(""fn"").value=""Mouse Down"";")
'Set the event.
ldField.MouseDown = action
'Save and close the PDF document.
doc.Save("output.pdf")
doc.Close(True)
MouseEnter
Gets or sets the action to be performed when the cursor enters the annotation's active area.
Declaration
public PdfAction MouseEnter { get; set; }
Property Value
Type | Description |
---|---|
PdfAction | The mouse enter action. |
Examples
//Load an existing document
PdfLoadedDocument doc = new PdfLoadedDocument("Form.pdf");
// Load the text box field
PdfLoadedTextBoxField ldField = doc.Form.Fields[0] as PdfLoadedTextBoxField;
//Reset fields bounds.
ldField.Bounds = new RectangleF(100, 300, 100, 30);
//Create a new PDF java script action instance.
PdfJavaScriptAction action = new PdfJavaScriptAction("getField(\"fn\").value=\"Mouse Entered\";");
//Set the mouse enter event.
ldField.MouseEnter = action;
//Save and close the PDF document.
doc.Save("output.pdf");
doc.Close(true);
'Load an existing document
Dim doc As New PdfLoadedDocument("Form.pdf")
' Load the text box field
Dim ldField As PdfLoadedTextBoxField = TryCast(doc.Form.Fields(0), PdfLoadedTextBoxField)
'Reset fields bounds.
ldField.Bounds = New RectangleF(100, 300, 100, 30)
'Create a new PDF java script action instance.
Dim action As New PdfJavaScriptAction("getField(""fn"").value=""Mouse Entered"";")
'Set the mouse enter event.
ldField.MouseEnter = action
'Save and close the PDF document.
doc.Save("output.pdf")
doc.Close(True)
MouseLeave
Gets or sets the action to be performed when the cursor exits the annotation's active area.
Declaration
public PdfAction MouseLeave { get; set; }
Property Value
Type | Description |
---|---|
PdfAction | The mouse leave action. |
Examples
//Load an existing document
PdfLoadedDocument doc = new PdfLoadedDocument("Form.pdf");
// Load the text box field
PdfLoadedTextBoxField ldField = doc.Form.Fields[0] as PdfLoadedTextBoxField;
//Reset fields bounds.
ldField.Bounds = new RectangleF(100, 300, 100, 30);
//Create a new PDF java script action instance.
PdfJavaScriptAction action = new PdfJavaScriptAction("getField(\"fn\").value=\"Mouse Leave\";");
//Set the event.
ldField.MouseLeave = action;
//Save and close the PDF document.
doc.Save("output.pdf");
doc.Close(true);
'Load an existing document
Dim doc As New PdfLoadedDocument("Form.pdf")
' Load the text box field
Dim ldField As PdfLoadedTextBoxField = TryCast(doc.Form.Fields(0), PdfLoadedTextBoxField)
'Reset fields bounds.
ldField.Bounds = New RectangleF(100, 300, 100, 30)
'Create a new PDF java script action instance.
Dim action As New PdfJavaScriptAction("getField(""fn"").value=""Mouse Leave"";")
'Set the event.
ldField.MouseLeave = action
'Save and close the PDF document.
doc.Save("output.pdf")
doc.Close(True)
MouseUp
Gets or sets the action to be performed when the mouse button is released inside the annotation's active area.
Declaration
public PdfAction MouseUp { get; set; }
Property Value
Type | Description |
---|---|
PdfAction | The mouse up action. |
Examples
//Load an existing document
PdfLoadedDocument doc = new PdfLoadedDocument("Form.pdf");
// Load the text box field
PdfLoadedTextBoxField ldField = doc.Form.Fields[0] as PdfLoadedTextBoxField;
//Reset fields bounds.
ldField.Bounds = new RectangleF(100, 300, 100, 30);
//Create a new PDF java script action instance.
PdfJavaScriptAction action = new PdfJavaScriptAction("getField(\"fn\").value=\"Mouse Up\";");
//Set the event.
ldField.MouseUp = action;
//Save and close the PDF document.
doc.Save("output.pdf");
doc.Close(true);
'Load an existing document
Dim doc As New PdfLoadedDocument("Form.pdf")
' Load the text box field
Dim ldField As PdfLoadedTextBoxField = TryCast(doc.Form.Fields(0), PdfLoadedTextBoxField)
'Reset fields bounds.
ldField.Bounds = New RectangleF(100, 300, 100, 30)
'Create a new PDF java script action instance.
Dim action As New PdfJavaScriptAction("getField(""fn"").value=""Mouse Up"";")
'Set the event.
ldField.MouseUp = action
'Save and close the PDF document.
doc.Save("output.pdf")
doc.Close(True)
RotationAngle
Gets and sets the Rotation angle in the FormFields.
Declaration
public int RotationAngle { get; set; }
Property Value
Type |
---|
System.Int32 |
Remarks
The rotation angle value shall be a multiple of 90. Default value: 0.
Examples
// Loads the file
PdfLoadedDocument loadedDocument = new PdfLoadedDocument(DataPathOutput + "CheckBox.pdf");
// Loads the field
PdfLoadedCheckBoxField loadedCheckBoxField = loadedDocument.Form.Fields[0] as PdfLoadedCheckBoxField;
// Gets and sets the rotation angle in the form fields
loadedCheckBoxField.RotationAngle = 90;
Assert.AreEqual(90, loadedCheckBoxField.RotationAngle);
loadedDocument.Form.SetDefaultAppearance(false);
// Save the pdf
loadedDocument.Save("Output.pdf");
// Close the pdf
loadedDocument.Close(true);
' Loads the file
Dim loadedDocument As PdfLoadedDocument = New PdfLoadedDocument(DataPathOutput + "CheckBox.pdf")
' Loads the field
Dim loadedCheckBoxField As PdfLoadedCheckBoxField = TryCast(loadedDocument.Form.Fields(0), PdfLoadedCheckBoxField)
' Gets and sets the rotation angle in the form fields
loadedCheckBoxField.RotationAngle = 90
Assert.AreEqual(90, loadedCheckBoxField.RotationAngle)
loadedDocument.Form.SetDefaultAppearance(False)
' Save the pdf
loadedDocument.Save("Output.pdf")
' Close the pdf
loadedDocument.Close(True)
Size
Gets or sets the size.
Declaration
public SizeF Size { get; set; }
Property Value
Type |
---|
SizeF |
Examples
//Load an existing document
PdfLoadedDocument doc = new PdfLoadedDocument("Form.pdf");
// Load the text box field
PdfLoadedTextBoxField ldField = doc.Form.Fields[0] as PdfLoadedTextBoxField;
//Reset size of the field.
ldField.Size = new SizeF(200, 30);
//Save and close the PDF document.
doc.Save("output.pdf");
doc.Close(true);
'Load an existing document
Dim doc As New PdfLoadedDocument("Form.pdf")
' Load the text box field
Dim ldField As PdfLoadedTextBoxField = TryCast(doc.Form.Fields(0), PdfLoadedTextBoxField)
'Reset size of the field.
ldField.Size = New SizeF(200, 30)
'Save and close the PDF document.
doc.Save("output.pdf")
doc.Close(True)
Visibility
Gets or sets the form field visibility
Declaration
public PdfFormFieldVisibility Visibility { get; set; }
Property Value
Type |
---|
PdfFormFieldVisibility |
Examples
//Load an existing document
PdfLoadedDocument doc = new PdfLoadedDocument("Form.pdf");
// Load the text box field
PdfLoadedTextBoxField ldField = doc.Form.Fields[0] as PdfLoadedTextBoxField;
ldField.Visibility = PdfFormFieldVisibility.Hidden;
//Save and close the PDF document.
doc.Save("output.pdf");
doc.Close(true);
'Load an existing document
Dim doc As New PdfLoadedDocument("Form.pdf")
' Load the text box field
Dim ldField As PdfLoadedTextBoxField = TryCast(doc.Form.Fields(0), PdfLoadedTextBoxField)
ldField.Visibility = PdfFormFieldVisibility.Hidden
'Save and close the PDF document.
doc.Save("output.pdf")
doc.Close(True)
Visible
Gets a value indicating the visibility of the field.[Read-Only]
Declaration
public bool Visible { get; }
Property Value
Type |
---|
System.Boolean |
Examples
//Load an existing document
PdfLoadedDocument doc = new PdfLoadedDocument("Form.pdf");
// Load the text box field
PdfLoadedTextBoxField ldField = doc.Form.Fields[0] as PdfLoadedTextBoxField;
bool isVisible = ldField.Visible;
//Save and close the PDF document.
doc.Save("output.pdf");
doc.Close(true);
'Load an existing document
Dim doc As New PdfLoadedDocument("Form.pdf")
' Load the text box field
Dim ldField As PdfLoadedTextBoxField = TryCast(doc.Form.Fields(0), PdfLoadedTextBoxField)
Dim isVisible As Boolean = ldField.Visible
'Save and close the PDF document.
doc.Save("output.pdf")
doc.Close(True)
Methods
DefineDefaultAppearance()
Defines the default appearance.
Declaration
protected override void DefineDefaultAppearance()
Overrides
GetGraphicsProperties(out PdfLoadedStyledField.GraphicsProperties, PdfLoadedFieldItem)
Gets the graphics properties.
Declaration
protected void GetGraphicsProperties(out PdfLoadedStyledField.GraphicsProperties graphicsProperties, PdfLoadedFieldItem item)
Parameters
Type | Name | Description |
---|---|---|
PdfLoadedStyledField.GraphicsProperties | graphicsProperties | The graphics properties. |
PdfLoadedFieldItem | item | The item. |
StyleToString(PdfCheckBoxStyle)
Styles to string.
Declaration
protected string StyleToString(PdfCheckBoxStyle style)
Parameters
Type | Name | Description |
---|---|---|
PdfCheckBoxStyle | style | The style. |
Returns
Type | Description |
---|---|
System.String | String representation of the check box' style. |