Quantcast

Sales:
(215) 821-7004

Class Reference

vuzit.Viewer

Vuzit document viewer control class.

Summary
vuzit.ViewerVuzit document viewer control class.
Functions
fromIdCreates a new Viewer object for a document with the requested web ID and returns it.
fromUrlCreates a new Viewer object for a document with the requested url and returns it.
constructor
destroyCleans up all objects and memory.
displayCreates the viewer display for the document defined in the “url” property.
getDocumentThe Document instance member.
getPageNumberThe current page number.
getUrlThe current URL of the document.
getZoomThe current zoom level.
hideHides the viewer on the page.
isDestroyedReturns whether the window is in destroyed state.
pageNextJumps to the next page.
pagePreviousJumps to the previous page.
searchClearAfter setSearch() is called, this clears the current search term highlighting.
searchNextAfter setSearch() is called, this jumps to the next matching search term.
searchPreviousAfter setSearch() is called, this jumps to the previous matching search term.
setFullScreenUrlSets the URL of the full screen link.
setPageNumberSets the current page.
setSizeSets the size of the control after initialization has occurred.
setIdSets the id of the document.
setUrlSets the URL of the document.
setZoomSets the current zoom level.
showUnhides the viewer on the screen.

Functions

fromId

fromId: function(id,
inputOptions)

Creates a new Viewer object for a document with the requested web ID and returns it.

Parameters

idThe document’s Vuzit web id
inputOptionsSets the options below a document when any events associated with it are logged.

Options

customA custom field is attached to each user behavior event.  Only valid if trackEvents is true.
includedPages(optional) Useful for generating document previews to provide a limited view of a document.  This is typically used for e-commerce and retail sites with the objective of selling the complete version.  Indexing begins at 0.  (Enterprise customers only).
onCompletefunction to run when the document has finished loading
signatureauthentication signature described here: http://vuzit.com/developer/documents_api
sslboolean whether or not to use SSL for your transactions (Premium customers only)
timestampauthentication timestamp described here: http://vuzit.com/developer/documents_api
trackEvents(optional) boolean value that specifies events if the Viewer should be tracking user behavior.  Default is true.
watermark(optional) Places arbitrary text on the viewer and on generated PDF files.  Typically used for identification purposes of the end-user that is viewing the document (Enterprise customers only).

Returns

vuzit.Viewer

Example

var viewer = vuzit.Viewer.fromId("1a", {onComplete: doSomething, ssl: false} );

fromUrl

fromUrl: function(url,
inputOptions)

Creates a new Viewer object for a document with the requested url and returns it.

Parameters

urlThe document’s url address
inputOptionsSets the options below a document when any events associated with it are logged.

Options

customA custom field is attached to each user behavior event.  Only valid if trackEvents is true.
includedPages(optional) Useful for generating document previews to provide a limited view of a document.  This is typically used for e-commerce and retail sites with the objective of selling the complete version.  Indexing begins at 0.  (Enterprise customers only).
onCompletefunction to run when the document has finished loading
setDownloadable(optional) set whether the “Download” button on the toolbar should be visible to the user (for URL based submissions only, parameter will be ignored all other times)
setPrintPdf(optional) set whether the “Print PDF” button on the toolbar should be visible to the user (for URL based submissions only, parameter will be ignored all other times)
signatureauthentication signature described here: http://vuzit.com/developer/documents_api
sslboolean whether or not to use SSL for your transactions (Premium customers only)
timestampauthentication timestamp described here: http://vuzit.com/developer/documents_api
trackEvents(optional) boolean value that specifies events if the Viewer should be tracking user behavior.  Default is true.
watermark(optional) Places arbitrary text on the viewer and on generated PDF files.  Typically used for identification purposes of the end-user that is viewing the document (Enterprise customers only).

Returns

vuzit.Viewer

Example

var viewer = vuzit.Viewer.fromUrl("http://someurl.com", {onComplete: doSomething, ssl: false} );

constructor

Parameters

identifierThe url address of the document
optionsSets the options below a document when any events associated with it are logged.

Options

customThis parameter is for providing additional information about a document when its associated events are logged.
includedPages(optional) Useful for generating document previews to provide a limited view of a document.  This is typically used for e-commerce and retail sites with the objective of selling the complete version.  Indexing begins at 0.  (Enterprise customers only).
onCompletefunction to run when the document has finished loading
setDownloadable(optional) set whether the “Download” button on the toolbar should be visible to the user (for URL based submissions only, parameter will be ignored all other times)
setPrintPdf(optional) set whether the “Print PDF” button on the toolbar should be visible to the user (for URL based submissions only, parameter will be ignored all other times)
signatureauthentication signature described here: http://vuzit.com/developer/documents_api
sslboolean whether or not to use SSL for your transactions (Premium customers only)
timestampauthentication timestamp described here: http://vuzit.com/developer/documents_api
trackEvents(optional) True/False value that specifies events in the Viewer should be logged.  Default is true.
watermark(optional) Places arbitrary text on the viewer and on generated PDF files.  Typically used for identification purposes of the end-user that is viewing the document (Enterprise customers only).

Returns

vuzit.Viewer

Example

var viewer = new vuzit.Viewer("http://someurl.com", {onComplete: doSomething, ssl: false} );

destroy

destroy: function()

Cleans up all objects and memory.

Parameters

none

Returns

none

Example

viewer.destroy();

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

disableShortcutsDisables keyboard shortcuts
onPageChangedCallback function that is executed when a document’s page is changed
pageSets the starting page.  Indexing begins at 0.  (Default: 0)
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
showPrintPdfSets whether to show the Print PDF button.  Button will only be shown for non-PDF and non-image documents.
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
simplePageShows the simple pager control.
simpleZoomShows the simple zoom control.
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();

searchClear

searchClear: function()

After setSearch() is called, this clears the current search term highlighting.

Parameters

none

Returns

none

Example

viewer.searchClear();

searchNext

searchNext: function()

After setSearch() is called, this jumps to the next matching search term.

Parameters

none

Returns

none

Example

viewer.searchNext();

searchPrevious

searchPrevious: function()

After setSearch() is called, this jumps to the previous matching search term.

Parameters

none

Returns

none

Example

viewer.searchPrevious();

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)

setId

setId: function(id)

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

Parameters

idSets the ID of the document

Returns

nothing

Example

viewer.setId('5');

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();
fromId: function(id,
inputOptions)
Creates a new Viewer object for a document with the requested web ID and returns it.
fromUrl: function(url,
inputOptions)
Creates a new Viewer object for a document with the requested url and returns it.
destroy: function()
Cleans up all objects and memory.
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.
searchClear: function()
After setSearch() is called, this clears the current search term highlighting.
searchNext: function()
After setSearch() is called, this jumps to the next matching search term.
searchPrevious: function()
After setSearch() is called, this jumps to the previous matching search term.
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.
setId: function(id)
Sets the id of the document.
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.