Class PdfLoadedStyledField
- Namespace
- Syncfusion.Pdf.Parsing
- Assembly
- Syncfusion.Pdf.Portable.dll
Represents loaded styled field.
public class PdfLoadedStyledField : PdfLoadedField, INotifyPropertyChanged
- Inheritance
-
PdfLoadedStyledField
- Implements
- Derived
- Inherited Members
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.
public PdfColor BorderColor { get; set; }
Property Value
- 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)
- See Also
BorderStyle
Gets or sets the style of the border.
public PdfBorderStyle BorderStyle { get; set; }
Property Value
- 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)
- See Also
BorderWidth
Gets or Sets the width of the border.
public float BorderWidth { get; set; }
Property Value
- float
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)
- See Also
Bounds
Gets or sets the bounds.
public RectangleF Bounds { get; set; }
Property Value
- 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)
- See Also
DefaultIndex
Gets or set the default index.
public int DefaultIndex { get; set; }
Property Value
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)
- See Also
Font
Gets or set the font.
public PdfFont Font { get; set; }
Property Value
- 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)
- See Also
GotFocus
Gets or sets the action to be performed when the annotation receives the input focus.
public PdfAction GotFocus { get; set; }
Property Value
- 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)
- See Also
Location
Gets or sets the location.
public PointF Location { get; set; }
Property Value
- 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)
- See Also
LostFocus
Gets or sets the action to be performed when the annotation loses the input focus.
public PdfAction LostFocus { get; set; }
Property Value
- 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)
- See Also
MouseDown
Gets or sets the action to be performed when the mouse button is pressed inside the annotation's active area.
public PdfAction MouseDown { get; set; }
Property Value
- 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)
- See Also
MouseEnter
Gets or sets the action to be performed when the cursor enters the annotation's active area.
public PdfAction MouseEnter { get; set; }
Property Value
- 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)
- See Also
MouseLeave
Gets or sets the action to be performed when the cursor exits the annotation's active area.
public PdfAction MouseLeave { get; set; }
Property Value
- 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)
- See Also
MouseUp
Gets or sets the action to be performed when the mouse button is released inside the annotation's active area.
public PdfAction MouseUp { get; set; }
Property Value
- 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)
- See Also
RotationAngle
Gets and sets the Rotation angle in the FormFields.
public int RotationAngle { get; set; }
Property Value
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)
Remarks
The rotation angle value shall be a multiple of 90. Default value: 0.
- See Also
Size
Gets or sets the size.
public SizeF Size { get; set; }
Property Value
- 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)
- See Also
Visibility
Gets or sets the form field visibility
public PdfFormFieldVisibility Visibility { get; set; }
Property Value
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)
- See Also
Visible
Gets a value indicating the visibility of the field.[Read-Only]
public bool Visible { get; }
Property Value
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)
- See Also
Methods
DefineDefaultAppearance()
Defines the default appearance.
protected override void DefineDefaultAppearance()
- See Also
GetGraphicsProperties(out GraphicsProperties, PdfLoadedFieldItem)
Gets the graphics properties.
protected void GetGraphicsProperties(out PdfLoadedStyledField.GraphicsProperties graphicsProperties, PdfLoadedFieldItem item)
Parameters
graphicsProperties
PdfLoadedStyledField.GraphicsPropertiesThe graphics properties.
item
PdfLoadedFieldItemThe item.
- See Also
StyleToString(PdfCheckBoxStyle)
Styles to string.
protected string StyleToString(PdfCheckBoxStyle style)
Parameters
style
PdfCheckBoxStyleThe style.
Returns
- string
String representation of the check box' style.
- See Also