Class PdfSoundAnnotation


public class PdfSoundAnnotation extends PdfMarkupAnnotation
  • Constructor Details

    • PdfSoundAnnotation

      public PdfSoundAnnotation (Rectangle rect, PdfStream sound)
      Creates a new Sound annotation. There is a problem playing *.wav files via internal player in Acrobat. The first byte of the audio stream data should be deleted, then wav file will be played correctly. Otherwise it will be broken. Other supporting file types don't have such problem. Sound annotations are deprecated in PDF 2.0.
      Parameters:
      rect - the rectangle that specifies annotation position and bounds on page
      sound - the PdfStream with sound
    • PdfSoundAnnotation

      protected PdfSoundAnnotation (PdfDictionary pdfObject)
      Instantiates a new PdfSoundAnnotation instance based on PdfDictionary instance, that represents existing annotation object in the document.
      Parameters:
      pdfObject - the PdfDictionary representing annotation object
      See Also:
    • PdfSoundAnnotation

      public PdfSoundAnnotation (PdfDocument document, Rectangle rect, InputStream soundStream, float sampleRate, PdfName encoding, int channels, int sampleSizeInBits) throws IOException
      Creates a sound annotation. Sound annotations are deprecated in PDF 2.0.
      Parameters:
      document - the PdfDocument to which annotation will be added
      rect - the rectangle that specifies annotation position and bounds on page
      soundStream - the PdfStream with sound
      sampleRate - the sampling rate, in samples per second
      encoding - the encoding format for the sample data
      channels - the number of sound channels
      sampleSizeInBits - the number of bits per sample value per channel
      Throws:
      IOException - in case of corrupted data or source stream problems
  • Method Details

    • getSubtype

      public PdfName getSubtype()
      Description copied from class: PdfAnnotation
      Gets a PdfName which value is a subtype of this annotation. See ISO-320001 12.5.6, "Annotation Types" for the reference to the possible types.
      Specified by:
      getSubtype in class PdfAnnotation
      Returns:
      subtype of this annotation.
    • getSound

      public PdfStream getSound()
    • getIconName

      public PdfName getIconName()
      The name of an icon that is used in displaying the annotation. Possible values are different for different annotation types. See setIconName(PdfName).
      Returns:
      a PdfName that specifies the icon for displaying annotation, or null if icon name is not specified.
    • setIconName

      public PdfSoundAnnotation setIconName (PdfName name)
      The name of an icon that is used in displaying the annotation.
      Parameters:
      name - a PdfName that specifies the icon for displaying annotation. Possible values are different for different annotation types:
      • Speaker
      • Mic
      Additional names may be supported as well.
      Returns:
      this PdfSoundAnnotation instance.