Class PdfAnnotationAdditionalActions

java.lang.Object
com.itextpdf.kernel.pdf.PdfObjectWrapper<PdfDictionary>
com.itextpdf.kernel.pdf.action.PdfAnnotationAdditionalActions

public class PdfAnnotationAdditionalActions extends PdfObjectWrapper<PdfDictionary>
A wrapper for annotations additional actions dictionaries. See section 12.6.3 Table 197 of ISO 32000-1. An annotation additional actions dictionary defines the event handlers for annotations
  • Constructor Details

    • PdfAnnotationAdditionalActions

      public PdfAnnotationAdditionalActions (PdfDictionary pdfObject)
  • Method Details

    • getOnEnter

      public PdfAction getOnEnter()
      Returns the PdfAction for the OnEnter event if there is any, or null.
      Returns:
      PdfAction or null
    • setOnEnter

      public void setOnEnter (PdfAction action)
      Sets the PdfAction to perform on the OnEnter event, or removes it when action is null.
      Parameters:
      action - The PdfAction to set or null to remove the action
    • getOnExit

      public PdfAction getOnExit()
      Returns the PdfAction for the OnExit event if there is any, or null.
      Returns:
      PdfAction or null
    • setOnExit

      public void setOnExit (PdfAction action)
      Sets the PdfAction to perform on the OnExit event, or removes it when action is null.
      Parameters:
      action - PdfAction The action to set or null to remove the action
    • getOnMouseDown

      public PdfAction getOnMouseDown()
      Returns the PdfAction for the OnMouseDown event if there is any, or null.
      Returns:
      PdfAction or null
    • setOnMouseDown

      public void setOnMouseDown (PdfAction action)
      Sets the PdfAction to perform on the OnMouseDown event, or removes it when action is null.
      Parameters:
      action - PdfAction The action to set or null to remove the action
    • getOnMouseUp

      public PdfAction getOnMouseUp()
      Returns the PdfAction for the OnMouseUp event if there is any, or null.
      Returns:
      PdfAction or null
    • setOnMouseUp

      public void setOnMouseUp (PdfAction action)
      Sets the PdfAction to perform on the OnMouseUp event, or removes it when action is null.
      Parameters:
      action - PdfAction The action to set or null to remove the action
    • getOnFocus

      public PdfAction getOnFocus()
      Returns the PdfAction for the OnFocus event if there is any, or null.
      Returns:
      PdfAction or null
    • setOnFocus

      public void setOnFocus (PdfAction action)
      Sets the PdfAction to perform on the OnFocus event, or removes it when action is null.
      Parameters:
      action - PdfAction The action to set or null to remove the action
    • getOnLostFocus

      public PdfAction getOnLostFocus()
      Returns the PdfAction for the OnLostFocus event if there is any, or null.
      Returns:
      PdfAction or null
    • setOnLostFocus

      public void setOnLostFocus (PdfAction action)
      Sets the PdfAction to perform on the OnLostFocus event, or removes it when action is null.
      Parameters:
      action - PdfAction The action to set or null to remove the action
    • getOnPageOpened

      public PdfAction getOnPageOpened()
      Returns the PdfAction for the OnPageOpened event if there is any, or null.
      Returns:
      PdfAction or null
    • setOnPageOpened

      public void setOnPageOpened (PdfAction action)
      Sets the PdfAction to perform on the OnPageOpened event, or removes it when action is null.
      Parameters:
      action - PdfAction The action to set or null to remove the action
    • getOnPageClosed

      public PdfAction getOnPageClosed()
      Returns the PdfAction for the OnPageClosed event if there is any, or null.
      Returns:
      PdfAction or null
    • setOnPageClosed

      public void setOnPageClosed (PdfAction action)
      Sets the PdfAction to perform on the OnPageClosed event, or removes it when action is null.
      Parameters:
      action - PdfAction The action to set or null to remove the action
    • getOnPageVisible

      public PdfAction getOnPageVisible()
      Returns the PdfAction for the OnPageVisible event if there is any, or null.
      Returns:
      PdfAction or null
    • setOnPageVisible

      public void setOnPageVisible (PdfAction action)
      Sets the PdfAction to perform on the OnPageVisible event, or removes it when action is null.
      Parameters:
      action - PdfAction The action to set or null to remove the action
    • getOnPageLostView

      public PdfAction getOnPageLostView()
      Returns the PdfAction for the OnPageLostView event if there is any, or null.
      Returns:
      PdfAction or null
    • setOnPageLostView

      public void setOnPageLostView (PdfAction action)
      Sets the PdfAction to perform on the OnPageLostView event, or removes it when action is null.
      Parameters:
      action - PdfAction The action to set or null to remove the action
    • getAllKnownActions

      public List<PdfAction> getAllKnownActions()
      Lists every PdfAction for all documented events for an annotation's additional actions. See section 12.6.3 Table 197 of ISO 32000-1
      Returns:
      The list of actions
    • getPdfActionForEvent

      public PdfAction getPdfActionForEvent (PdfName eventName)
      If exists, returns the PdfAction for this event, otherwise returns null.
      Parameters:
      eventName - The PdfName for the event.
      Returns:
      the PdfAction or null
    • setPdfActionForEvent

      public void setPdfActionForEvent (PdfName event, PdfAction action)
      Sets the action for an event, or removes it when the action is null.
      Parameters:
      event - the event to set or remove the action for
      action - the PdfAction to set or null
    • isWrappedObjectMustBeIndirect

      protected boolean isWrappedObjectMustBeIndirect()
      Defines if the object behind this wrapper must be an indirect object in the resultant document.

      If this method returns true it doesn't necessarily mean that object must be in the indirect state at any moment, but rather defines that when the object will be written to the document it will be transformed into indirect object if it's not indirect yet.

      Return value of this method shouldn't depend on any logic, it should return always true or false.
      Specified by:
      isWrappedObjectMustBeIndirect in class PdfObjectWrapper<PdfDictionary>
      Returns:
      true if in the resultant document the object behind the wrapper must be indirect, otherwise false.