<!DOCTYPE html>
<html>

<head>
	<meta charset="UTF-8">
	<meta name="apple-mobile-web-app-capable" content="yes">
	<meta name="apple-mobile-web-app-status-bar-style" content="black">
	<meta name="format-detection" content="telephone=no" />
	<meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=no">
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">
	<title >查看文档</title>
	<link rel="stylesheet" href="css/pdfh5/style.css" />
	<link rel="stylesheet" href="css/pdfh5/pdfh5.css" />
	<style>
		.pdfContent {
			width: 100%;
			height: 100%;
			overflow: hidden;
			background: #fff;
			position: relative;
		}
	</style>
</head>

<body>
	<div style="padding:10px 0px 10px 10px">
		<span onclick="closepage()" >
			返回
		</span>
	</div>
	
	<div class="pdfContent"></div>
	
	<script src="js/pdfh5/pdf.js" type="text/javascript" charset="utf-8"></script>
	<script src="js/pdfh5/pdf.worker.js" type="text/javascript" charset="utf-8"></script>
	<script src="js/pdfh5/jquery-1.11.3.min.js" type="text/javascript" charset="utf-8"></script>
	<script src="js/pdfh5/pdfh5.js" type="text/javascript" charset="utf-8"></script>
	<script type="text/javascript">
		localStorage.setItem("h5router", "/ecompany/waitsign");

		var _v = getUrlParam("pdfname");
		console.log("val = " + _v);

		var pdfView = new Pdfh5('.pdfContent', {
			pdfurl: "/" + _v + ".pdf"
		});
		pdfView.on("start",function(initTime){
			console.log("Pdfh5开始初始化")
		});
		pdfView.on("complete",function(status,msg,time){
			console.log("Pdfh5加载完成,总页数："+this.totalNum)
		});
		pdfView.on("scroll",function(scrollTop){
			console.log("Pdfh5滚动监听",scrollTop)
		});
		pdfView.on("renderPages",function(currentPageDom){
			console.log("Pdfh5加载pdf监听",currentPageDom,this.currentNum)
		});

		function getUrlParam(name) {
            var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)"); //构造一个含有目标参数的正则表达式对象
            var r = window.location.search.substr(1).match(reg);  //匹配目标参数
            if (r != null) return unescape(r[2]); return null; //返回参数值
		}
		
		function closepage() {
			window.history.back(-1);
		}

	</script>
</body>

</html>