Documentation

API

The following set of functions and events can be used to interact with FlexPaper (as of FlexPaper 1.4.0 and onwards).
All methods and events can be seen and tested using this test page


Functions

  .gotoPage(Number pageNumber) navigates the viewer to the specified page
  .fitWidth() sets the viewer to fit width mode
  .fitHeight() sets the viewer to fit height mode
  .loadSwf(String swffile) loads a new document into the viewer
  .getCurrPage() returns the current page number
  .nextPage() move to next page in the loaded document
  .prevPage() move to previous page in the loaded document
  .setZoom(Number factor) zoom the viewer to the specified factor
  .searchText(String text) search the loaded document for the specified text
  .switchMode(String mode) switch viewing mode. Allowed modes are "Portrait", "Two Page", "Tile"
  .printPaper() print the loaded document
  .highlight(String url) highlights all matches in a document according to Adobe's XML highlighting specification
  .postSnapshot(String url) posts a snapshot of the current document page to the specified url


Events

  onDocumentLoaded (no arguments) fired when the document has finished loading
  onDocumentLoadedError (String errormessage) fired when a error occurred in loading a document
  onProgress (Number bytesloaded, Number bytestotal) fired when the document is loading
  onCurrentPageChanged (Number pagenumber) fired when the currently viewer page has changed
  onExternalLinkClicked (String link) fired when a user clicks a external link. Only works when supplying argument "-s linknameurl" in conversion with PDF2SWF.
  onDocumentPrinted (no arguments) fired when a document has finished printing (sent to the print spooler)