title: Not able to use PrintDocument in IIS
body: <p>I am running an asp.net application's app pool under my ID which has access to Printer. Below is my code which uses <code>DrawString</code> to print a string generated from code.</p>
  
  <pre><code> PrintDocument pd = new PrintDocument();
   pd.PrinterSettings.PrinterName = @"\\aPrint\0007-BOND";
   pd.PrintPage += new PrintPageEventHandler(pd_PrintPage);
   pd.Print();
  </code></pre>
  
  <p>and <code>pd_PrintPage</code> is defined below</p>
  
  <pre><code>private void pd_PrintPage(object sender, PrintPageEventArgs ev)
      {
          try
          {
              System.Drawing.Font f = new System.Drawing.Font("Courier New", 12);
              ev.Graphics.DrawString(props, f, Brushes.Black, 100, 100);
              ev.HasMorePages = false;
          }
          catch(Exception ex)
          {
              ex.ToString();
          }
  
      }
  </code></pre>
  
  <p>Above code works well in my Visual Studio whereas giving error when deployed on IIS. I believe my printer settings and permissions are good as i can print other documents using 'COM' library functions like <code>Word</code>, <code>Excel</code> etc</p>
  
  <p>What's wrong in my shared code? Please suggest</p>