iframe - Print a document with JavaScript -
i want open print dialog file(docx,pdf,...) via sharepoint workflow. there call url , pass url of file after ? this:
http://www.sharepoint_intranet.com/print.html?link-to-file.pdf
edit: tried:
<script type="text/javascript"> //get url of 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>
the print dialog opening , in print options there point "only selected frame" selected when press print button nothing happen.
thanks help!
you can put in body of html
<body onload="window.print();">
so page opened prints document.
Comments
Post a Comment