Class RichMediaAnnotation


  • public class RichMediaAnnotation
    extends Object
    Object that is able to create Rich Media Annotations as described in the document "Acrobat Supplement to the ISO 32000", referenced in the code as "ExtensionLevel 3". This annotation is described in section 9.6 entitled "Rich Media" of this document. Extension level 3 introduces rich media PDF constructs that support playing a SWF file and provide enhanced rich media. With rich media annotation, Flash applications, video, audio, and other multimedia can be attached to a PDF with expanded functionality. It improves upon the existing 3D annotation structure to support multiple multimedia file assets, including Flash video and compatible variations on the H.264 format. The new constructs allow a two-way scripting bridge between Flash and a conforming application. There is support for generalized linking of a Flash application state to a comment or view, which enables video commenting. Finally, actions can be linked to video chapter points.
    Since:
    5.0.0
    • Field Detail

      • writer

        protected PdfWriter writer
        The PdfWriter to which the annotation will be added.
      • richMediaContent

        protected PdfDictionary richMediaContent
        the rich media content (can be reused for different annotations)
      • richMediaContentReference

        protected PdfIndirectReference richMediaContentReference
        a reference to the RichMediaContent that can be reused.
      • richMediaSettings

        protected PdfDictionary richMediaSettings
        the rich media settings (specific for this annotation)
      • configurations

        protected PdfArray configurations
        an array with configurations (will be added to the RichMediaContent).
      • views

        protected PdfArray views
        an array of views (will be added to the RichMediaContent)
    • Constructor Detail

      • RichMediaAnnotation

        public RichMediaAnnotation​(PdfWriter writer,
                                   Rectangle rect)
        Creates a RichMediaAnnotation.
        Parameters:
        writer - the PdfWriter to which the annotation will be added.
        rect - the rectangle where the annotation will be added.
      • RichMediaAnnotation

        public RichMediaAnnotation​(PdfWriter writer,
                                   Rectangle rect,
                                   PdfIndirectReference richMediaContentReference)
        Creates a RichMediaAnnotation using rich media content that has already been added to the writer. Note that assets, configurations, views added to a RichMediaAnnotation created like this will be ignored.
        Parameters:
        writer - the PdfWriter to which the annotation will be added.
        rect - the rectangle where the annotation will be added.
        richMediaContentReference - reused rich media content.
    • Method Detail

      • getRichMediaContentReference

        public PdfIndirectReference getRichMediaContentReference()
        Gets a reference to the RichMediaContent for reuse of the rich media content. Returns null if the content hasn't been added to the OutputStream yet.
        Returns:
        a PdfDictionary with RichMediaContent
      • setActivation

        public void setActivation​(RichMediaActivation richMediaActivation)
        Sets the RichMediaActivation dictionary specifying the style of presentation, default script behavior, default view information, and animation style when the annotation is activated. (Part of the RichMediaSettings.)
        Parameters:
        richMediaActivation -
      • setDeactivation

        public void setDeactivation​(RichMediaDeactivation richMediaDeactivation)
        Sets the RichMediaDeactivation dictionary specifying the condition that causes deactivation of the annotation. (Part of the RichMediaSettings.)
        Parameters:
        richMediaDeactivation -
      • createAnnotation

        public PdfAnnotation createAnnotation()
                                       throws IOException
        Creates the actual annotation and adds different elements to the PdfWriter while doing so.
        Returns:
        a PdfAnnotation
        Throws:
        IOException