Class: SoundAnnot

PDFNet. SoundAnnot


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.

Methods


<static> create(doc, pos)

Constructor

Parameters:
Name Type Description
doc PDFNet.SDFDoc
pos PDFNet.Rect
Returns:

A promise that resolves to an object of type: "SoundAnnot"

Type
PDFNet.SoundAnnot

<static> createAtPoint(doc, pos)

Parameters:
Name Type Description
doc PDFNet.SDFDoc
pos PDFNet.Point
Returns:

A promise that resolves to an object of type: "SoundAnnot"

Type
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: "SoundAnnot"

Type
PDFNet.SoundAnnot

<static> createFromObj(d)

creates a Sound annotation and initializes it using given Cos/SDF object.

Parameters:
Name Type Description
d PDFNet.Obj

The Cos/SDF object to initialze the annotation with.

Returns:

A promise that resolves to an object of type: "SoundAnnot"

Type
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
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
string

getSoundStream()

Returns the sound object of the Sound annotation.

Returns:

A promise that resolves to an SDF object representing a sound stream.

Type
PDFNet.Obj

setIcon(type)

sets the Icon of the Sound annotation. (Optional)

Parameters:
Name Type Description
type number/enum
PDFNet.SoundAnnot.Icon = {
	e_Speaker : 0
	e_Mic : 1
	e_Unknown : 2
}

A value of the "Icon" enumeration type. Default value: e_Speaker.


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.


setSoundStream(icon)

sets the sound object of the Sound annotation.

Parameters:
Name Type Description
icon PDFNet.Obj

An SDF object representing a sound stream.