New Vuzit JavaScript API
February 26, 2008 – 11:09 am by Brent MatzelleWe just released a new version of Vuzit. This release includes the Vuzit JavaScript API, which includes two objects: Viewer and Document. They will give you a lot of control over your documents. Read on.
Viewer Object
The Viewer object controls the document viewer. Use it to change pages, zoom levels, and more. Here is a list of some capabilities:
- Page through the document: nextPage, previousPage, and setPage
- Get the current page number: getPageNumber
- Resize the viewer: setSize
- Set and get the zoom level: setZoom and getZoom
- Set and get the URL of the document: setUrl and getUrl
- Event trigger when the viewer is done loading: onComplete (via setUrl)
- Get the document properties: getDocument (see Document object below)
Viewer usage: See this example.
Document Object
The Document object allows you to load various properties of the document like the number of pages, title, URL, and more. Here is a list of some capabilities:
- Number of pages: getPageCount
- Number of zoom levels: getZoomCount
- Size of the original document: getFileSize
- Title: getTitle
- Subject: getSubject
- URL: getUrl
- Width and height in pixels: getWidth and getHeight
- Last time the document was modified: getModifiedAt
Document usage: See this example.
We built the documentation using Natural Docs, the best document generator for JavaScript (in our opinion). It’s free and open source.