Good morning,
I am considering to use WebViewer for a project. I need pdf files to be visible inside a web page and I think that WebViewer can be a good choise for that.
I am trying to create a sample web page, but I am having problems: when I try to instantiate an instance of PDFTron.WebViewer, an exception is thrown, with the message "'$' non è definito" ("'$' is undefined").
Am I doing something wrong?
Thanks a lot and regards.
This is the html code I wrote:
<html>
<head>
<script type="text/javascript" src="WebViewer/lib/WebViewer.min.js"></script>
<script type="text/javascript" src="jquery-1.7.2.min.js"></script>
<script type="text/javascript" src="WebViewer.min.js"></script>
<!-- WebViewer Universal Theming -->
<link type="text/css" rel="stylesheet" href="WebViewer/lib/resources/themes/cloud/jquery-ui-1.10.0.custom.min.css">
<link type="text/css" rel="stylesheet" href="WebViewer/lib/resources/themes/classic/icons.css"> <!-- use the extra icon set for the classic theme -->
<link type="text/css" rel="stylesheet" href="WebViewer/lib/resources/themes/classic/icons.css" media="screen"> <!-- use the extra icon set for the classic theme -->
<script type="text/javascript">
function er(){
var viewerElement = document.getElementById('viewer');
document.getElementById('state').innerHTML = "step1";
try{
var myWebViewer = new PDFTron.WebViewer({type: "html5,Silverlight,flash", initialDoc: "
http://pdftron.s3.amazonaws.com/files/xod/NY_fun_list.xod"}, viewerElement);
document.getElementById('state').innerHTML += "</br>step2";
}
catch(e){
document.getElementById('state').innerHTML += "</br>"+e.message;
}
}
</script>
</head>
<body>
<p>
Test
</p>
<div id="viewer">
</div>
<div id="state">
bbb
</div>
<script>
er();
</script>
</body>
</html>