Creates a new Viewer object for a document with the requested web ID and returns it.
Parameters
id
The document’s Vuzit web id
inputOptions
Sets the options below a document when any events associated with it are logged.
Options
custom
A 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).
onComplete
function to run when the document has finished loading
(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
url
The document’s url address
inputOptions
Sets the options below a document when any events associated with it are logged.
Options
custom
A 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).
onComplete
function 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)
(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
identifier
The url address of the document
options
Sets the options below a document when any events associated with it are logged.
Options
custom
This 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).
onComplete
function 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)
(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
div
Viewer html element <div>
options
Sets the options below
Options
disableShortcuts
Disables keyboard shortcuts
onPageChanged
Callback function that is executed when a document’s page is changed
page
Sets the starting page. Indexing begins at 0. (Default: 0)
x
Sets the position in the X direction. (Default: 0)
y
Sets the position in the Y direction. (Default: 0)
showDownload
Sets whether to show the download button
showPrintPdf
Sets whether to show the Print PDF button. Button will only be shown for non-PDF and non-image documents.
showFullScreen
Sets whether to show the full screen link
showZooms
Sets whether to show zoom buttons
showPages
Sets whether to show the page number textbox and next page/previous page arrows