我想通过 SharePoint 工作流打开文件(docx、pdf、...)的打印对话框。在那里我用 GET 调用 URL 并在 ? 之后传递文件的 URL。像这样:
http://www.sharepoint_intranet.com/print.html?link-to-file.pdf
编辑:我也试过:
<script type="text/javascript">
//Get the URL of the file
var urlOfFile = window.location.search.replace("?", "");
document.write("<iframe id=" + "printDocument" + " src=" + "'" + urlOfFile + "'" + " width=" + "600" + " height=" + "400" + "></iframe>");
window.frames['printDocument'].focus();
window.frames['printDocument'].print();
</script>
打印对话框正在打开,在打印选项中选择了“仅选定的帧”点,但是当我按下打印按钮时,什么都不会发生。
谢谢你的帮助!