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

Popular posts from this blog

blackberry 10 - how to add multiple markers on the google map just by url? -

php - guestbook returning database data to flash -

delphi - Dynamic file type icon -