Requirement

The multimedia model in PDF requires /RichMedia annotations. This has the following consequences:

  1. Multimedia rendition is performed through Flash. No Android or iOS support.

  2. Because of that, sound formats are limited almost to MP3. No Opus, in any case.

  3. To get miliseconds in sound length and positions, a player that provides them is required—to avoid getting seconds only.

So it seems that I need a special SWF player for sound that allows milliseconds as time unit (and not only seconds).

Code That Worked for Me

Full Screen Mode

app.fs.isFullScreen = true; toggles application to fullscreen (when it wasn’t before).

Advance Page

this.pageNum += 1; (or this.pageNum++;) goes to next page (but it needs a page number to be set before, such as this.pageNum = 0;).1

app.setInterval works in an unclear way (at least, to me):2

  • This seems to me the standard way of setting an interval (at least, this is the way it works in ActionScript):

      this.pageNum = 0;
      app.setInterval("this.pageNum += 1;", 200);
    

    The interval seems to be forgotten after not so many loops. The number isn’t constant and it isn’t related to the time.

  • Adding a .count seems to solve the problem:

      this.pageNum = 0;
      function GoToNextPage() {
          this.pageNum += 1;
      }
      timeout = app.setInterval("GoToNextPage()", 10);
      timeout.count = 0
    

    Basic Page Navigation

this.pageNum = 0;

function GoToFirstPage() {
  this.pageNum = 0;
}

function GoToLastPage() {
  this.pageNum = this.numPages;
}

function GoToNextPage() {
  this.pageNum += 1;
}

function GoToPreviousPage() {
  this.pageNum -= 1;
}

function GoFS() {
  app.fs.isFullScreen = true;
}

function SwitchFS() {
  if (app.fs.isFullScreen == true)
    app.fs.isFullScreen = false;
  else
    app.fs.isFullScreen = true;
}

Notes

  1. The same applies to this.pageNum -= 1; or this.pageNum--;

  2. This might be explained in the setInterval entry from the API reference