Class PdfActionCollection
- Namespace
- Syncfusion.Pdf.Interactive
- Assembly
- Syncfusion.Pdf.Portable.dll
Represents collection of actions.
public class PdfActionCollection : PdfCollection, IEnumerable
- Inheritance
-
PdfActionCollection
- Implements
- Inherited Members
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.
public PdfActionCollection()
- See Also
Methods
Add(PdfAction)
Adds the specified action to the collection
public int Add(PdfAction action)
Parameters
Returns
- int
The index of the action in the collection
- See Also
Clear()
Clears the action collection.
public void Clear()
- See Also
Contains(PdfAction)
Determines whether the action is contained within collection.
public bool Contains(PdfAction action)
Parameters
Returns
- bool
Value, indicating the presents of the action in collection.
- See Also
IndexOf(PdfAction)
Gets the index of the action.
public int IndexOf(PdfAction action)
Parameters
Returns
- int
Index of the action
- See Also
Insert(int, PdfAction)
Inserts the action at the specified position.
public void Insert(int index, PdfAction action)
Parameters
index
intThe index in the collection where the action to be inserted
action
PdfActionThe PdfAction
- See Also
Remove(PdfAction)
Removes the specified action from the collection
public void Remove(PdfAction action)
Parameters
- See Also
RemoveAt(int)
Removes the action at the specified index from the collection
public void RemoveAt(int index)
Parameters
index
intThe index.
- See Also