Class AnnotationSound

  • All Implemented Interfaces:

    public final class AnnotationSound
    extends PDFAnnotation

    A subtype of PDFAnnotation that allows audio samples to be attached to the PDF. There are several ways to add audio to Acrobat - this approach is the "Acrobat 5.0" compatible approach as described in Acrobat 9.0. The other main approach is to add a playSound action to a FormButton or similar object.

    • Constructor Detail

      • AnnotationSound

        public AnnotationSound()
        Create a new Sound annotation. To actually set the attachment, the setSound() method must be called.
    • Method Detail

      • setType

        public void setType​(String type,
                            Color color)
        Set the type of attachment - the physical appearance on the page. The type must be one of the three pre-defined types (Speaker, Mic or Ear) or an IllegalArgumentException will be thrown.
        type - the type of attachment - one of the three values listed above.
        color - the color of the attachment
      • setSound

        public void setSound​(PDFSound sound)
        Set the contents of this annotation to the specified sound.
        sound - the PDFSound object to use
      • getSound

        public PDFSound getSound()
        Return the PDFSound from this annotation
      • toString

        public String toString()
      • putLiteral

        public void putLiteral​(String key,
                               String tokens)
        Put a literal token sequnce. For debugging
        key - the key
        tokens - the token sequence, eg "true" or "/foo" or "[/Foo/Bar]". No refs, just direct objects.