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>
印刷ダイアログが開いていて、印刷オプションで「選択したフレームのみ」が選択されていますが、印刷ボタンを押しても何も起こりません。
助けてくれてありがとう!