Quantcast

Class Reference

vuzit. Viewer

Vuzit document viewer control class.

Summary
Vuzit document viewer control class.
Cleans up all objects and memory.
Cleans up all objects and memory related only to displaying a Viewer on a screen
Creates the viewer display for the document defined in the “url” property.
The Document instance member.
The current page number.
The current URL of the document.
The current zoom level.
Hides the viewer on the page.
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.
Sets the current zoom level.
Unhides the viewer on the screen.

Functions

constructor

Parameters

urladdress of the document
sslboolean whether or not to use SSL for your transactions (Premium customers only)
onCompletefunction to run when the document has finished loading

Returns

vuzit.Viewer

Example

var viewer = new vuzit.Viewer("http://someurl.com", functionOnComplete);

destroy

destroy: function()

Cleans up all objects and memory.

Parameters

none

Returns

none

Example

viewer.destroy();

destroyDisplay

destroyDisplay: function()

Cleans up all objects and memory related only to displaying a Viewer on a screen

Parameters

none

Returns

none

Example

viewer.destroyDisplay();

display

display: function(div,
options)

Creates the viewer display for the document defined in the “url” property.

Parameters

divViewer html element <div>
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)
showDownloadSets whether to show the download button
showFullScreenSets whether to show the full screen link
showZoomsSets whether to show zoom buttons
showPagesSets whether to show the page number textbox and next page/previous page arrows
zoomSets the zoom level for the page.  (Default: 1)

Returns

none

Example

viewer.display(document.getElementById('vuzit_view'), {zoom: 1 });

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();

hide

hide: function()

Hides the viewer on the page.

Parameters

none

Returns

none

Example

viewer.hide();

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)

Sets the URL of the document.  Called by the constructor, but can also be called afterwards to bring in a new document to the Viewer.

Parameters

urlSets the URL of the document

Returns

nothing

Example

viewer.setUrl('http://example.com/some.pdf');

setZoom

setZoom: function(zoom)

Sets the current zoom level.

Parameters

zoomThe new zoom level

Returns

string

Example

viewer.setZoom(0);

show

show: function()

Unhides the viewer on the screen.

Parameters

none

Returns

none

Example

viewer.show();
destroy: function()
Cleans up all objects and memory.
destroyDisplay: function()
Cleans up all objects and memory related only to displaying a Viewer on a screen
display: function(div,
options)
Creates the viewer display for the document defined in the “url” property.
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.
hide: function()
Hides the viewer on the page.
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)
Sets the URL of the document.
setZoom: function(zoom)
Sets the current zoom level.
show: function()
Unhides the viewer on the screen.

Documentation generated by Natural Docs.