FlowPaper JavaScript API

Use the FlowPaper JavaScript API to control viewer behavior and react to document events.

Functions

Method Description
gotoPage(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(swffile) Loads a new document into the viewer.
getCurrPage() Returns the current page number.
nextPage() Moves to the next page in the loaded document.
prevPage() Moves to the previous page in the loaded document.
setZoom(factor) Zooms the viewer to the specified factor.
searchText(text) Searches the loaded document for the specified text.
switchMode(mode) Switches viewing mode. Allowed modes are Portrait, Two Page, and Tile.
printPaper() Prints the loaded document.
highlight(url) Highlights all matches in a document according to Adobe’s XML highlighting specification.
postSnapshot(url) Posts a snapshot of the current document page to the specified URL.

Events

Event Description
onDocumentLoaded Fired when the document has finished loading.
onDocumentLoadedError(errormessage) Fired when an error occurred while loading a document.
onProgress(bytes, bytestotal) Fired while the document is loading.
onCurrentPageChanged(pagenumber) Fired when the current viewer page has changed.
onExternalLinkClicked(link) Fired when a user clicks an external link. Only works when supplying argument -s linknameurl in conversion with PDF2SWF.
onDocumentPrinted Fired when a document has finished printing (sent to the print spooler).

Copyright © Devaldi Ltd.
Copyright © 2026 ◾ Devaldi Ltd