Class PdfResetAction
Represents PDF form's reset action,this action allows a user to reset the form fields to their default values.
Implements
Namespace: Syncfusion.Pdf.Interactive
Assembly: Syncfusion.Pdf.UWP.dll
Syntax
public class PdfResetAction : PdfFormAction, IPdfWrapper
Remarks
This PdfResetAction class is used to reset all the form fields in the PDF document. Please refer the UG docuemntation link https://help.syncfusion.com/file-formats/pdf/working-with-action#reset-action for more details.
Examples
//Create a new PDF document.
PdfDocument document = new PdfDocument();
//Create a new page
PdfPage page = document.Pages.Add();
//Create a PdfButtonField
PdfButtonField submitButton = new PdfButtonField(page, "submitButton");
submitButton.Bounds = new RectangleF(25, 160, 100, 20);
submitButton.Text = "Apply";
//Create a new PdfResetAction
PdfResetAction resetAction = new PdfResetAction();
//Set the resetAction to submitButton
submitButton.Actions.GotFocus = resetAction;
//Add the submit button to a document.
document.Form.Fields.Add(submitButton);
//Save document to disk.
document.Save("ResetAction.pdf");
document.Close(true);
'Create a new PDF document.
Dim document As New PdfDocument()
'Create a new page
Dim page As PdfPage = document.Pages.Add()
'Create a PdfButtonField
Dim submitButton As New PdfButtonField(page, "submitButton")
submitButton.Bounds = New RectangleF(25, 160, 100, 20)
submitButton.Text = "Apply"
'Create a new PdfResetAction
Dim resetAction As New PdfResetAction()
'Set the resetAction to submitButton
submitButton.Actions.GotFocus = resetAction
'Add the submit button to a document.
document.Form.Fields.Add(submitButton)
'Save document to disk.
document.Save("ResetAction.pdf")
document.Close(True)
Constructors
PdfResetAction()
Initializes a new instance of the PdfResetAction class.
Declaration
public PdfResetAction()
Examples
//Create a new PDF document.
PdfDocument document = new PdfDocument();
//Create a new page
PdfPage page = document.Pages.Add();
//Create a PdfButtonField
PdfButtonField submitButton = new PdfButtonField(page, "submitButton");
submitButton.Bounds = new RectangleF(25, 160, 100, 20);
submitButton.Text = "Apply";
//Create a new PdfResetAction
PdfResetAction resetAction = new PdfResetAction();
//Set the resetAction to submitButton
submitButton.Actions.GotFocus = resetAction;
//Add the submit button to a document.
document.Form.Fields.Add(submitButton);
//Save document to disk.
document.Save("ResetAction.pdf");
document.Close(true);
'Create a new PDF document.
Dim document As New PdfDocument()
'Create a new page
Dim page As PdfPage = document.Pages.Add()
'Create a PdfButtonField
Dim submitButton As New PdfButtonField(page, "submitButton")
submitButton.Bounds = New RectangleF(25, 160, 100, 20)
submitButton.Text = "Apply"
'Create a new PdfResetAction
Dim resetAction As New PdfResetAction()
'Set the resetAction to submitButton
submitButton.Actions.GotFocus = resetAction
'Add the submit button to a document.
document.Form.Fields.Add(submitButton)
'Save document to disk.
document.Save("ResetAction.pdf")
document.Close(True)
See Also
Properties
Include
Gets or sets a value indicating whether fields contained in Fields collection will be included for resetting.
Declaration
public override bool Include { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
|
Overrides
Remarks
If Include property is true, only the fields in this collection will be reset. If Include property is false, the fields in this collection are not reset and only the remaining form fields are reset. If the collection is null or empty, then all the form fields are reset and the Include property is ignored.
Examples
//Create a new PDF document.
PdfDocument document = new PdfDocument();
//Create a new page
PdfPage page = document.Pages.Add();
//Create a PdfButtonField
PdfButtonField submitButton = new PdfButtonField(page, "submitButton");
submitButton.Bounds = new RectangleF(25, 160, 100, 20);
submitButton.Text = "Apply";
//Create a new PdfResetAction
PdfResetAction resetAction = new PdfResetAction();
resetAction.Include=true;
//Set the resetAction to submitButton
submitButton.Actions.GotFocus = resetAction;
//Add the submit button to a document.
document.Form.Fields.Add(submitButton);
//Save document to disk.
document.Save("ResetAction.pdf");
document.Close(true);
'Create a new PDF document.
Dim document As New PdfDocument()
'Create a new page
Dim page As PdfPage = document.Pages.Add()
'Create a PdfButtonField
Dim submitButton As New PdfButtonField(page, "submitButton")
submitButton.Bounds = New RectangleF(25, 160, 100, 20)
submitButton.Text = "Apply"
'Create a new PdfResetAction
Dim resetAction As New PdfResetAction()
resetAction.Include=True
'Set the resetAction to submitButton
submitButton.Actions.GotFocus = resetAction
'Add the submit button to a document.
document.Form.Fields.Add(submitButton)
'Save document to disk.
document.Save("ResetAction.pdf")
document.Close(True)
See Also
Methods
Initialize()
Initializes an instance.
Declaration
protected override void Initialize()