title: GDI printing not triggering printer
body: <p>I am writing a printing application in c#. In my application i done following steps</p>
  
  <ul>
  <li>Created Device context (hdc)</li>
  <li>Created and started Document StartDoc</li>
  <li>Created and Started Page StartPage</li>
  <li>Assigned images to context</li>
  <li>called BitBlt and assigned conext to right hdc</li>
  <li>EndPage(hdc)</li>
  <li>EndDoc(hdc)</li>
  </ul>
  
  <p>After all these steps, printing is not trigered. I want to ask that printing should be trigered itself
  after all these steps or i need to trigger it by some other method?</p>
  
  <p>Following is source code where CardPrinterLib is class in which i imported gdi32.dll and mapped its function</p>
  
  <pre><code>IntPtr hdc = IntPtr.Zero;
  hdc = CardPrinterLib.CreateDC(null, ps.PrinterName, null, IntPtr.Zero);
  
  
  CardPrinterLib.DOCINFO docinfo = new CardPrinterLib.DOCINFO();
  
  docinfo.cbSize = Marshal.SizeOf(docinfo);
  docinfo.pDocName = "PrinterTest";
  docinfo.pOutputFile = null;
  docinfo.pDataType = null;
  docinfo.fwType = 0;
  
   if (CardPrinterLib.StartDoc(hdc, ref docinfo) &gt; 0)
        {                        
            if (CardPrinterLib.StartPage(hdc) &gt; 0)
               {
                  Bitmap bmpFrontCard = (Bitmap)imgFrontCard;
                  Graphics grFrontCard = this.CreateGraphics();
                  IntPtr dcFrontCard = grFrontCard.GetHdc();
                  IntPtr chdcFrontCard = CardPrinterLib.CreateCompatibleDC(dcFrontCard);
                  CardPrinterLib.SelectObject(chdcFrontCard, bmpFrontCard.GetHbitmap());
                  Graphics ghdcFrontCard = Graphics.FromHdc(chdcFrontCard);
                  grFrontCard.ReleaseHdc(dcFrontCard);
                  IntPtr hhdcFrontCard = ghdcFrontCard.GetHdc();
  
                  bool resultFrontCard = CardPrinterLib.BitBlt(hdc, 0, 0, 994, 624, hhdcFrontCard, 0, 0, 13369376);
  
                   CardPrinterLib.EndPage(hdc);
  
                }                                      
  CardPrinterLib.EndDoc(hdc);                   
  CardPrinterLib.DeleteDC(hdc);
  </code></pre>