|
|
@@ -13,9 +13,8 @@ var winWidth;
|
|
|
|
|
|
getWindowWidth();
|
|
|
loadPdfData();
|
|
|
-getDocument();
|
|
|
|
|
|
-//是否立即打印
|
|
|
+// 是否立即打印
|
|
|
var printType = getParameter("printType");
|
|
|
if (printType && printType == 'PRINT') {
|
|
|
hiddenframe.onload = function() {
|
|
|
@@ -110,11 +109,26 @@ function loadPdfData() {
|
|
|
async : false,
|
|
|
url : loadPdfDataUrl,
|
|
|
success : function(data) {
|
|
|
+ // 返回的pdf文件路径
|
|
|
var pdfPath = data.pdfPath;
|
|
|
hiddenframe.src = pdfPath;
|
|
|
+ // 获取所对应的分页的pdf文件路径
|
|
|
url = pdfPath.replace(".pdf", "_" + pageIndex + ".pdf");
|
|
|
pageSize = data.pageSize;
|
|
|
document.getElementById('page_size').textContent = pageSize;
|
|
|
+ document.title = getParameter("reportName");
|
|
|
+ getDocument();
|
|
|
+ },
|
|
|
+ error : function(XMLHttpRequest) {
|
|
|
+ var viewerContainer = document.getElementById("viewerContainer");
|
|
|
+ viewerContainer.removeChild(document.getElementById("the-canvas"));
|
|
|
+ var p = document.createElement("p");
|
|
|
+ p.style.color = "#fff";
|
|
|
+ p.style.textAlign = "left";
|
|
|
+ p.style.marginLeft = "20px";
|
|
|
+ // 将返回的错误信息显示在页面上
|
|
|
+ p.textContent = XMLHttpRequest.responseText;
|
|
|
+ viewerContainer.appendChild(p);
|
|
|
}
|
|
|
});
|
|
|
};
|