关于html页面展现pdf文件,并隐藏打印、下载等按钮的总结
由于项目需求,要在页面预览pdf文件而不能提供下爱打印功能,故在网上查询了一些前辈的经验,自己也尝试了一番,现在讲经验总结一下。
- pdfobject.js
- jquery.media.js
- pdf.js
一、 pdfobject.js
1.下载:https://pdfobject.com/
2.导入相关js
3.实例
<!DOCTYPE html>
<html>
<meta charset="utf-8">
<head th:include="include :: header">
</head>
<style type="text/css">
#toolbarViewerRight{
display: none;
}
html,body,#pdf_viewer{
width: 100%;
height: 100%;
margin: 0;