We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
文件预览会添加打印功能吗?目前调用浏览器自带的打印功能会导致打印出边框和图标。 测试了下修改officePicture.ftl模板可以添加打印功能,目前只试了转成pdf预览的文件可以打印 `
function printPage(){ const images = document.querySelectorAll('.my-photo'); let html = ''; images.forEach(image => { html += image.outerHTML; }) printHtml(html) } function printHtml (html) { const bodyHtml = document.body.innerHTML; document.body.innerHTML = html; window.print(); document.body.innerHTML = bodyHtml; }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
文件预览会添加打印功能吗?目前调用浏览器自带的打印功能会导致打印出边框和图标。
<title>PDF图片预览</title> <#include "*/commonHeader.ftl"> <script src="js/lazyload.js"></script> <style> body { background-color: #404040; } .container { width: 100%; height: 100%; } .img-area { text-align: center; } .my-photo { max-width: 98%; margin:0 auto; border-radius:3px; box-shadow:rgba(0,0,0,0.15) 0 0 8px; background:#FBFBFB; border:1px solid #ddd; margin:1px auto; padding:5px; } @media print { @page { margin-top: 0px; margin-bottom: 0px; } .my-photo { border: none !important; /* 使用!important以确保覆盖其他可能存在的样式 */ box-shadow: none !important; /* 去除可能存在的阴影 */ outline: none !important; /* 去除可能存在的轮廓 */ width: 100% !important; } } </style>测试了下修改officePicture.ftl模板可以添加打印功能,目前只试了转成pdf预览的文件可以打印
`
<script> window.onload = function () { /*初始化水印*/ initWaterMark(); checkImgs(); }; window.onscroll = throttle(checkImgs); function changePreviewType(previewType) { var url = window.location.href; if (url.indexOf("officePreviewType=image") !== -1) { url = url.replace("officePreviewType=image", "officePreviewType="+previewType); } else { url = url + "&officePreviewType="+previewType; } if ('allImages' === previewType) { window.open(url) } else { window.location.href = url; } }
The text was updated successfully, but these errors were encountered: