title: Open another page or image in print Preview
body: <p>I am trying to create a printer friendly page. 
  We've got that sorted using thirdparty software that snapshots the page and spits out image files. Now we have created a link to the image page and would like to create a javascript that opens print preview directly.</p>
  
  <p>I have found two javascripts first to open in a new page and another one to open print preview .This all works on IE 9. I need to combine these two javascripts :-)</p>
  
  <p>I have tried anything I know to combine them without success.. 
  Could I please get some help from the gurus? :-)</p>
  
  <p>First script:</p>
  
  <pre><code>    function printpage(url)
  {
    child = window.open(url, "", "height=1, width=1");  //Open the child in a tiny window.
  
    window.focus();  //Hide the child as soon as it is opened.
    //child.print();  //Print the child. &lt;-- I need this to call PrintPreview()
    child.close();  //Immediately close the child.
   }
  </code></pre>
  
  <p>Second script  the print Preview part</p>
  
  <pre><code>function PrintPreview()
  {
    var OLECMDID =  7;
  
    /* OLECMDID values:
    * 6 - print
    * 7 - print preview
    * 0 - open window
    * 4 - Save As
    */
  
    var PROMPT = 1; // 1 PROMPT USER 2 DON'T PROMPT USER
    var WebBrowser = '&lt;OBJECT ID="WebBrowser1" WIDTH=0 HEIGHT=0 CLASSID="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2"&gt;&lt;/OBJECT&gt;';
  
  
    window.document.body.insertAdjacentHTML('beforeEnd', WebBrowser);
  
    WebBrowser1.ExecWB(OLECMDID, PROMPT);
    WebBrowser1.outerHTML = "";
  
  }   
  </code></pre>
  
  <p>Any help is very much appreciated.</p>