Table of Contents

Class PdfResetAction

Namespace
Syncfusion.Pdf.Interactive
Assembly
Syncfusion.Pdf.Portable.dll

Represents PDF form's reset action,this action allows a user to reset the form fields to their default values.

public class PdfResetAction : PdfFormAction
Inheritance
PdfResetAction
Inherited Members

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)

Remarks

This PdfResetAction class is used to reset all the form fields in the PDF document. Please refer the UG docuemntation link for more details.

Constructors

PdfResetAction()

Initializes a new instance of the PdfResetAction class.

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.

public override bool Include { get; set; }

Property Value

bool

true if include; otherwise, false.

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)

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.

See Also

Methods

Initialize()

Initializes an instance.

protected override void Initialize()
See Also

See Also