75
1)
Pass a FlashVar to ViewerEnterprise.swf to indicate you will be sending events to Viewer
getViewerEvents=Yes
2)
Add the JavaScript code in your page as shown below
<script>
documentviewer = $.flash.create(
{
swf: 'ViewerEnterprise.swf',
id:'ViewerEnterprise',
height: 600,
width: 750,
wmode: 'window',
scale: 'noscale',
allowFullScreen: true,
allowScriptAccess: 'always',
hasVersion: 10,
hasVersionFail: function (options) {
alert("You do not have required flash version");
},
encodeParams: false,
bgcolor: '#ffffff',
flashvars: {
documentname: '<%=document %>',
getViewerEvents:'Yes',
}
}
);
$(document).ready(
function () {
$('#documentviewer').html(documentviewer);
}
);
</script>
The following events are sent by ViewerEnterprise.swf:
Event
Details
OnDocumentError(documentname, pagenumber)
A custom HTTP Status Error Code 500
is returned from conversion url instead
of converted swf
viewerOnDocumentZoom(documentname,zoom)
Zoom is pressed.
Returns documentname & zoom size
viewerOnDocumentScroll(documentname)
Document is scrolled
viewerOnDocumentLoad(documentname)
Document is loaded in the viewer
viewerOnDocumentDownload(documentname)
Document is downloaded/Save button
was pressed
viewerOnDocumentRotate(documentname)
Document is rotated by 90 degree
viewerOnDocumentPrint(documentname)
Print button was clicked
viewerOnDocumentFullScreen(documentname)
Document is viewed in Full Screen
Mode
viewerOnSelectText(documentname,pagenumber,startp
os,endpos,selecetdtext)
Text is selected on document.
Returns Document Name, Page
Number, Start Character Position of
Text Highlighted, End Character
Position of Text Highlighted, Selected
Text Contents
viewerOnDocumentTextSelected(documentname)
After text selection is complete
viewerOnInternalLinkClick(pageClicked)
An internal link in document is clicked.
Like bookmark or link to another page
in the document
viewerOnExternalLinkClick(linkUrl)
An external link in document is clicked.
38