1

I have written a code to print a cheque using MICR font, every thing works fine but when coming to print preview I am getting normal text but while printing the document I am getting the required in MICR font. How can I show MICR font in print preview

This is my code

PrivateFontCollection PFC = new PrivateFontCollection();
    PFC.AddFontFile(Server.MapPath("ADVMICR.TTF"));
    FontFamily fm = new FontFamily(PFC.Families[0].Name, PFC);
    Font PrintFont = new Font(fm, 12);

    PrintDocument pd = new PrintDocument();
    pd.PrintPage += new PrintPageEventHandler(pd_PrintPage);
    // Specify the printer to use.
    pd.PrinterSettings.PrinterName = "SnagIt 9";
    PrintPreviewDialog ppdlg = new PrintPreviewDialog();
    ppdlg.Document = pd;
    ppdlg.ShowDialog();
ArunPratap
  • 4,816
  • 7
  • 25
  • 43
Vivekh
  • 4,141
  • 11
  • 57
  • 102

1 Answers1

0

Try this

ppdlg.PrintPreviewControl.Font = new Font("ADVMICR.TTF", 12);

Developer
  • 8,390
  • 41
  • 129
  • 238