1

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>

印刷ダイアログが開いていて、印刷オプションで「選択したフレームのみ」が選択されていますが、印刷ボタンを押しても何も起こりません。

助けてくれてありがとう!

4

3 に答える 3

-1

ファイルのパスを与えることができます ("abc.doc"/"abc.xls")

var urlOfFile = window.location.search.replace("?", "");

于 2013-10-01T13:06:46.523 に答える