title: Print webbrowser content as landscape
body: <p>I need to print document from WebBrowser control as landscape (without showing PrintPreview and changing default printer page orientation).</p>
  
  <p>I've tried: </p>
  
  <ol>
  <li><p>TemplatePrinter
  Here's my template template.html:</p>
  
  <pre><code>&lt;HTML XMLNS:IE&gt;
  &lt;HEAD&gt;
  &lt;?IMPORT NAMESPACE="IE" IMPLEMENTATION="#default"&gt;
  &lt;TITLE&gt;Landscape&lt;/TITLE&gt;
  &lt;/HEAD&gt;
  &lt;BODY&gt;
  &lt;IE:TEMPLATEPRINTER id="Printer"/&gt;
  &lt;SCRIPT Language="JavaScript"&gt;
  Printer.orientation="landscape";
  &lt;/SCRIPT&gt;
  &lt;/BODY&gt;
  &lt;/HTML&gt;
  </code></pre>
  
  <p>And I try to use it:</p>
  
  <pre><code>mshtml.IHTMLDocument2 doc = wbReport.Document.DomDocument as mshtml.IHTMLDocument2;
  doc.execCommand("print", false, "template.tpl");
  </code></pre></li>
  <li><p>Create reg key "orientation" with value "2" in HKCU\Software\Microsoft\Internet Explorer\PageSetup</p></li>
  <li><p>Add style like:</p>
  
  <pre><code>&lt;style type="text/css" media="print"&gt;
  @page
  {
   size: landscape;
   margin: 2cm;
  }
  &lt;/style&gt;
  </code></pre></li>
  </ol>
  
  <p>But I still print my html as portrait.
  Maybe there is better solution to print html as landscape or I have some mistakes when using TemplatePrinter?</p>