本文介绍了无法在打印preVIEW查看MICR字体的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经写了code。使用MICR字体来打印支票,每一件事情工作正常,但来打印preVIEW我得到正常的文本,但在打印过程中我得到的文档时,在MICR字体要求。我怎样才能显示打印preVIEW MICR字体

这是我的code

  PrivateFontCollection PFC =新PrivateFontCollection();
    PFC.AddFontFile(使用Server.Mappath(ADVMICR.TTF));
    的FontFamily FM =新的FontFamily(PFC.Families [0] .name和PFC);
    字体PrintFont =新Font(FM,12);    PrintDocument的PD =​​新的PrintDocument();
    pd.PrintPage + =新PrintPageEventHandler(pd_PrintPage);
    //指定要使用的打印机。
    pd.PrinterSettings.PrinterName =SnagIt的9;
    打印previewDialog ppdlg =新打印previewDialog();
    ppdlg.Document = PD;
    ppdlg.ShowDialog();


解决方案

试试这个

ppdlg.Print previewControl.Font =新的字体(ADVMICR.TTF,12);

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();
解决方案

Try this

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

这篇关于无法在打印preVIEW查看MICR字体的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-01 04:11