new SoundAnnot()
A Sound annotation represents a sound recording attached to a point in
the PDF document. When closed, this annotation appear as an icon; when open
and activated, a sound record from the computer's microphone or imported from a file
associated with this annotation is played.The icon of this annotation by default
is a speaker.
Extends
- MarkupAnnot
Members
-
<static> Icon
-
Properties:
Name Type Description e_Speaker
number e_Mic
number e_Unknown
number
Methods
-
<static> create(doc, pos)
-
Constructor
Parameters:
Name Type Description doc
PDFNet.PDFDoc | PDFNet.SDFDoc | PDFNet.FDFDoc pos
PDFNet.Rect Returns:
A promise that resolves to an object of type: "PDFNet.SoundAnnot"- Type
- Promise.<PDFNet.SoundAnnot>
-
<static> createAtPoint(doc, pos)
-
Parameters:
Name Type Description doc
PDFNet.PDFDoc | PDFNet.SDFDoc | PDFNet.FDFDoc pos
PDFNet.Point Returns:
A promise that resolves to an object of type: "PDFNet.SoundAnnot"- Type
- Promise.<PDFNet.SoundAnnot>
-
<static> createFromAnnot(ann)
-
creates a Sound annotation and initializes it using given annotation object.
Parameters:
Name Type Description ann
PDFNet.Annot Annot object used to initialize the Sound annotation. Returns:
A promise that resolves to an object of type: "PDFNet.SoundAnnot"- Type
- Promise.<PDFNet.SoundAnnot>
-
<static> createFromObj( [d])
-
creates a Sound annotation and initializes it using given Cos/SDF object.
Parameters:
Name Type Argument Description d
PDFNet.Obj <optional>
The Cos/SDF object to initialze the annotation with. Returns:
A promise that resolves to an object of type: "PDFNet.SoundAnnot"- Type
- Promise.<PDFNet.SoundAnnot>
-
<static> createWithData(doc, pos, stream, sample_bits, sample_freq, num_channels)
-
Parameters:
Name Type Description doc
PDFNet.PDFDoc | PDFNet.SDFDoc | PDFNet.FDFDoc pos
PDFNet.Rect stream
PDFNet.Filter sample_bits
number sample_freq
number num_channels
number Returns:
A promise that resolves to an object of type: "PDFNet.SoundAnnot"- Type
- Promise.<PDFNet.SoundAnnot>
-
getIcon()
-
Returns the Icon of the Sound annotation.
Returns:
A promise that resolves to a value of the "Icon" enum. Default value: e_Speaker.- Type
- Promise.<number>
Example
Return value enum: <pre> PDFNet.SoundAnnot.Icon = { e_Speaker : 0 e_Mic : 1 e_Unknown : 2 } </pre>
-
getIconName()
-
Returns the Icon name of the Sound annotation.
Returns:
A promise that resolves to a string denoting the Icon name of the Sound annotation.- Type
- Promise.<string>
-
getSoundStream()
-
Returns the sound object of the Sound annotation.
Returns:
A promise that resolves to an SDF object representing a sound stream.- Type
- Promise.<PDFNet.Obj>
-
setIcon( [type])
-
sets the Icon of the Sound annotation. (Optional)
Parameters:
Name Type Argument Description type
number <optional>
PDFNet.SoundAnnot.Icon = { e_Speaker : 0 e_Mic : 1 e_Unknown : 2 }
A value of the "Icon" enumeration type specifying the icon to display. Default value: e_Speaker.Returns:
- Type
- Promise.<void>
-
setIconName(type)
-
sets the Icon name of the Sound annotation. (Optional)
Parameters:
Name Type Description type
string A string denoting the Icon name of the Sound annotation. Returns:
- Type
- Promise.<void>
-
setSoundStream(icon)
-
sets the sound object of the Sound annotation.
Parameters:
Name Type Description icon
PDFNet.Obj An SDF object representing a sound stream. Returns:
- Type
- Promise.<void>