Quantcast

Class Reference

vuzit. Viewer

Vuzit document viewer control class.

Summary
Vuzit document viewer control class.
Cleans up all objects and memory.
The Document instance member.
The current page number.
The current URL of the document.
The current zoom level.
Returns whether the window is in destroyed state.
Jumps to the next page.
Jumps to the previous page.
Sets the URL of the full screen link.
Sets the current page.
Sets the size of the control after initialization has occurred.
Sets the URL of the document to view.
Sets the current zoom level.

Functions

constructor

Parameters

divViewer html element <div>

Returns

vuzit.Viewer

Example

var viewer = new vuzit.Viewer(document.getElementById('viewer'));

destroy

destroy: function()

Cleans up all objects and memory.

Parameters

none

Returns

none

Example

viewer.destroy();

getDocument

getDocument: function()

The Document instance member.

Parameters

none

Returns

vuzit.Document

Example

var document = viewer.getDocument();

getPageNumber

getPageNumber: function()

The current page number.

Parameters

none

Returns

integer

Example

var page_num = viewer.getPageNumber();

getUrl

getUrl: function()

The current URL of the document.

Parameters

none

Returns

string

Example

var url = viewer.getUrl();

getZoom

getZoom: function()

The current zoom level.

Parameters

none

Returns

integer

Example

var zoom_level = viewer.getZoom();

isDestroyed

isDestroyed: function()

Returns whether the window is in destroyed state.

Parameters

none

Returns

boolean

Example

if (! viewer.isDestroyed) {
viewer.setPageNumber(2);
}

pageNext

pageNext: function()

Jumps to the next page.

Parameters

none

Returns

none

Example

viewer.pageNext();

pagePrevious

pagePrevious: function()

Jumps to the previous page.

Parameters

none

Returns

none

Example

viewer.pagePrevious();

setFullScreenUrl

setFullScreenUrl: function(url)

Sets the URL of the full screen link.  The URL must have a “$[URL]” sub-sting in it to set the proper link.

Parameters

urlThe new url link

Returns

none

Example

viewer.setFullScreenUrl('http://example.com/viewer.htm?url=$[URL]');

setPageNumber

setPageNumber: function(page)

Sets the current page.

Parameters

pageThe new page number

Returns

none

Example

viewer.setPageNumber(2);

setSize

setSize: function(width,
height)

Sets the size of the control after initialization has occurred.  Useful for handling onresize events.

Parameters

widthThe width in pixels
heightThe height in pixels

Returns

none

Example

viewer.setSize(640, 480)

setUrl

setUrl: function(url,
options)

Sets the URL of the document to view.  This is the trigger method that loads the document into the viewer.

Parameters

urlSets the URL of the document
optionsSets the options below

Options

pageSets the default page.  (Default: 1)
xSets the position in the X direction.  (Default: 0)
ySets the position in the Y direction.  (Default: 0)
onCompleteFunction to call when the document is finished loading
showDownloadSets whether to show the download button
showFullScreenSets whether to show the full screen link
zoomSets the zoom level for the page.  (Default: 1)

Returns

string

Example

viewer.setUrl('http://example.com/some.pdf', { zoom: 1, page: 2 });

setZoom

setZoom: function(zoom)

Sets the current zoom level.

Parameters

zoomThe new zoom level

Returns

string

Example

viewer.setZoom(0);
destroy: function()
Cleans up all objects and memory.
getDocument: function()
The Document instance member.
getPageNumber: function()
The current page number.
getUrl: function()
The current URL of the document.
getZoom: function()
The current zoom level.
isDestroyed: function()
Returns whether the window is in destroyed state.
pageNext: function()
Jumps to the next page.
pagePrevious: function()
Jumps to the previous page.
setFullScreenUrl: function(url)
Sets the URL of the full screen link.
setPageNumber: function(page)
Sets the current page.
setSize: function(width,
height)
Sets the size of the control after initialization has occurred.
setUrl: function(url,
options)
Sets the URL of the document to view.
setZoom: function(zoom)
Sets the current zoom level.

Documentation generated by Natural Docs.