1.首先你需要下载pdf.js
2.下载后解压全部放置你的静态文件目录
3.项目中引用,基本是点击按钮
<a href='javascript:void(0);' onclick=\"xdjj.Export('" + row.formNo + "')\"><span class='glyphicon glyphicon-list-alt' aria-hidden='true'>打印</span></a>
//打印
xdjj={};
Export: function (formNos) {
var exportUrl = (XXX/print.do?formNos=' + formNos);
//另一页打开
window.open("/Content/Third/pdf/web/viewer.html?file=" + encodeURIComponent(exportUrl));
//当前页打开方式
//var index = layer.open({
// type: 2,
// area: ['90%', '90%'],//宽,高
// fix: true, //不固定
// maxmin: true,
// content: ["/Content/Third/pdf/web/viewer.html?file=" + encodeURIComponent(exportUrl), 'no'],
//});
//layer.title("打印", index);
}