This is a question about the PDF specification regarding how to use the javascript API
to play a sound object.
Specifically, why in my basic example is the javascript able to see the sound,
but can't play() it?
I have a test PDF illustrating my problem at
http://www.affexion.net/test/PDF/test-scriptsound.pdf
This is a stripped down example.
The sound is referenced from a simple annotation
on the left. Double-clicking it plays the sound as expected.
On the right is a button which when activated is supposed to
execute a javascript.
<< /S /JavaScript /JS ( console.show(); try {this.sounds[0].play(); } catch(e) { console.println(e.toString()); } console.println(this.sounds[0].name); ) >>
I see the console open up, and I see it print the name of the sound "mySound",
but I don't get the sound played.
Do I need to do something in my javascript before I call this.sounds[0].play?
Is there some other mistake in the way I have the sound object embedded and referenced?
Thanks very much for any help.
to play a sound object.
Specifically, why in my basic example is the javascript able to see the sound,
but can't play() it?
I have a test PDF illustrating my problem at
http://www.affexion.net/test/PDF/test-scriptsound.pdf
This is a stripped down example.
The sound is referenced from a simple annotation
on the left. Double-clicking it plays the sound as expected.
On the right is a button which when activated is supposed to
execute a javascript.
<< /S /JavaScript /JS ( console.show(); try {this.sounds[0].play(); } catch(e) { console.println(e.toString()); } console.println(this.sounds[0].name); ) >>
I see the console open up, and I see it print the name of the sound "mySound",
but I don't get the sound played.
Do I need to do something in my javascript before I call this.sounds[0].play?
Is there some other mistake in the way I have the sound object embedded and referenced?
Thanks very much for any help.