<%@ page language="java" import="java.util.*" pageEncoding="UTF-8" %>
|
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
|
<%
|
String path = request.getContextPath();
|
String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
|
+ path + "/";
|
%>
|
|
<!DOCTYPE HTML>
|
<html>
|
<head>
|
<base href="<%=basePath%>">
|
<meta name="viewport" charset="width=device-width, initial-scale=1.0">
|
<meta http-equiv="X-UA-Compatible" content="ie=edge">
|
<title>文件浏览</title>
|
<!--[if lt IE 9]>
|
<script type="text/javascript" src="static/plugins/json2.js"></script>
|
<![endif]-->
|
<style type="text/css">
|
.viewer {
|
width: 100%;
|
border: 1px solid black;
|
position: relative;
|
}
|
</style>
|
<script>
|
function OnPDFCtrlInit() {
|
<c:if test="${downloadPermission}">
|
pdfctrl.AddCustomToolButton("下载", "DownloadFile()", 5);
|
</c:if>
|
<c:if test="${printPermission}">
|
pdfctrl.AddCustomToolButton("打印", "PrintFile()", 6);
|
</c:if>
|
pdfctrl.AddCustomToolButton("隐藏/显示书签", "SetBookmarks()", 0);
|
pdfctrl.AddCustomToolButton("-", "", 0);
|
pdfctrl.AddCustomToolButton("实际大小", "SetPageReal()", 16);
|
pdfctrl.AddCustomToolButton("适合页面", "SetPageFit()", 17);
|
pdfctrl.AddCustomToolButton("适合宽度", "SetPageWidth()", 18);
|
pdfctrl.AddCustomToolButton("-", "", 0);
|
pdfctrl.AddCustomToolButton("放大", "ZoomIn()", 14);
|
pdfctrl.AddCustomToolButton("缩小", "ZoomOut()", 15);
|
pdfctrl.AddCustomToolButton("-", "", 0);
|
pdfctrl.AddCustomToolButton("首页", "FirstPage()", 8);
|
pdfctrl.AddCustomToolButton("上一页", "PreviousPage()", 9);
|
pdfctrl.AddCustomToolButton("下一页", "NextPage()", 10);
|
pdfctrl.AddCustomToolButton("尾页", "LastPage()", 11);
|
pdfctrl.AddCustomToolButton("-", "", 0);
|
pdfctrl.AddCustomToolButton("向左旋转90度", "SetRotateLeft()", 12);
|
pdfctrl.AddCustomToolButton("向右旋转90度", "SetRotateRight()", 13);
|
pdfctrl.AddCustomToolButton("-", "", 0);
|
pdfctrl.AddCustomToolButton("全屏/还原", "SwitchFullScreen()", 4);
|
}
|
|
function DownloadFile(){
|
pdfctrl.ShowDialog(2);
|
}
|
|
function SetBookmarks() {
|
pdfctrl.BookmarksVisible = !pdfctrl.BookmarksVisible;
|
}
|
|
function PrintFile() {
|
pdfctrl.ShowDialog(4);
|
}
|
|
function SwitchFullScreen() {
|
pdfctrl.FullScreen = !pdfctrl.FullScreen;
|
}
|
|
function SetPageReal() {
|
pdfctrl.SetPageFit(1);
|
}
|
|
function SetPageFit() {
|
pdfctrl.SetPageFit(2);
|
}
|
|
function SetPageWidth() {
|
pdfctrl.SetPageFit(3);
|
}
|
|
function ZoomIn() {
|
pdfctrl.ZoomIn();
|
}
|
|
function ZoomOut() {
|
pdfctrl.ZoomOut();
|
}
|
|
function FirstPage() {
|
pdfctrl.GoToFirstPage();
|
}
|
|
function PreviousPage() {
|
pdfctrl.GoToPreviousPage();
|
}
|
|
function NextPage() {
|
pdfctrl.GoToNextPage();
|
}
|
|
function LastPage() {
|
pdfctrl.GoToLastPage();
|
}
|
|
function SetRotateRight() {
|
pdfctrl.RotateRight();
|
}
|
|
function SetRotateLeft() {
|
pdfctrl.RotateLeft();
|
}
|
</script>
|
</head>
|
<body>
|
<div class="margin-lr">
|
<input type="hidden" id="attachUrl"/>
|
<div style=" width:auto; height:800px;">
|
${pageoffice}
|
</div>
|
</div>
|
</body>
|
</html>
|