Reputation: 1
Everything works in flexpaper but it's api ...
I' using the free version of flexpaper but when I use their API like:
function onDocumentLoaded(totalPages){
getDocViewer().searchText('UK');
}
as shown in Flexpaper examples, but nothing seems to work...
Anyone already had this issue? Thanks
Upvotes: 0
Views: 953
Reputation: 34
You can try this code:
<script type="text/javascript">
$(function() {
$('#documentViewer').bind('onDocumentLoaded',function(){
window.$FlexPaper = window.getDocViewer = window["$FlexPaper"] = function(id){
var instance = (id==="undefined")?"":id;
if (window['ViewerMode'] == 'flash') {
return window["FlexPaperViewer_Instance"+instance].getApi();
}else if(window['ViewerMode'] == 'html'){
return window["FlexPaperViewer_Instance"+instance];
}
};
$FlexPaper('documentViewer').searchText('UK');
});
});
</script>
Where $FlexPaper is your FlexPaper instance's ID
Upvotes: 0
Reputation: 175
Not sure what version of FlexPaper you are using, but I noticed that somewhere between 1.4.2 and 1.5.1 the getDocViewer function was silently removed from the support javascript code. There is no mention of this removal in the change log.
Upvotes: 1