PdfActionCollection Class
Represents collection of actions.
Implements
System.Collections.IEnumerable
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Syncfusion.Pdf.Interactive
Assembly: Syncfusion.Pdf.Base.dll
Syntax
public class PdfActionCollection : PdfCollection, IEnumerable
Examples
//Create a new PDF document.
PdfDocument document = new PdfDocument();
//Create a new page.
PdfPage page = document.Pages.Add();
//Create font and font style.
PdfFont font = new PdfStandardFont(PdfFontFamily.Helvetica, 12f, PdfFontStyle.Bold);
//Create a new PdfButtonField.
PdfButtonField submitButton = new PdfButtonField(page, "submitButton");
submitButton.Bounds = new RectangleF(25, 160, 100, 20);
submitButton.Font = font;
submitButton.Text = "Goto";
submitButton.BackColor = new PdfColor(181, 191, 203);
//Create a new page and adds it as the last page of the document.
PdfPage pdfPages = document.Pages.Add();
//Create a new PdfGoToAction.
PdfGoToAction gotoAction = new PdfGoToAction(pdfPages);
//Add the gotoAction.
submitButton.Actions.GotFocus = gotoAction;
//Add the submit button to a new document.
document.Form.Fields.Add(submitButton);
//Save document to disk.
document.Save("GoToAction.pdf");
//close the document.
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 font and font style.
Dim font As PdfFont = New PdfStandardFont(PdfFontFamily.Helvetica, 12F, PdfFontStyle.Bold)
'Create a new PdfButtonField.
Dim submitButton As New PdfButtonField(page, "submitButton")
submitButton.Bounds = New RectangleF(25, 160, 100, 20)
submitButton.Font = font
submitButton.Text = "Goto"
submitButton.BackColor = New PdfColor(181, 191, 203)
'Create a new page and adds it as the last page of the document.
Dim pdfPages As PdfPage = document.Pages.Add()
'Create a new PdfGoToAction.
Dim gotoAction As New PdfGoToAction(pdfPages)
'Add the gotoAction.
submitButton.Actions.GotFocus = gotoAction
'Add the submit button to a new document.
document.Form.Fields.Add(submitButton)
'Save document to disk.
document.Save("GoToAction.pdf")
'close the document.
document.Close(True)
Constructors
PdfActionCollection()
Initializes a new instance of the PdfActionCollection class.
Declaration
public PdfActionCollection()
Methods
Add(PdfAction)
Adds the specified action to the collection
Declaration
public int Add(PdfAction action)
Parameters
Type | Name | Description |
---|---|---|
PdfAction | action | The PdfAction |
Returns
Type | Description |
---|---|
System.Int32 | The index of the action in the collection |
Clear()
Clears the action collection.
Declaration
public void Clear()
Contains(PdfAction)
Determines whether the action is contained within collection.
Declaration
public bool Contains(PdfAction action)
Parameters
Type | Name | Description |
---|---|---|
PdfAction | action | The PdfAction. |
Returns
Type | Description |
---|---|
System.Boolean | Value, indicating the presents of the action in collection. |
IndexOf(PdfAction)
Gets the index of the action.
Declaration
public int IndexOf(PdfAction action)
Parameters
Type | Name | Description |
---|---|---|
PdfAction | action | The PdfAction. |
Returns
Type | Description |
---|---|
System.Int32 | Index of the action |
Insert(Int32, PdfAction)
Inserts the action at the specified position.
Declaration
public void Insert(int index, PdfAction action)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | index | The index in the collection where the action to be inserted |
PdfAction | action | The PdfAction |
Remove(PdfAction)
Removes the specified action from the collection
Declaration
public void Remove(PdfAction action)
Parameters
Type | Name | Description |
---|---|---|
PdfAction | action | The PdfAction. |
RemoveAt(Int32)
Removes the action at the specified index from the collection
Declaration
public void RemoveAt(int index)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | index | The index. |
Implements
System.Collections.IEnumerable