5

我有 LQ EPSON 300 打印机

我想用打印机的默认字体打印一些数据

我认为如果我们使用 c# 代码以该打印机的默认字体进行打印,这将是可能的。

PrintDocument pd = new PrintDocument();
pd.DefaultPageSettings.PaperSize = new PaperSize("A4", 950, 555);
pd.PrintPage += new PrintPageEventHandler(this.FontAndLocation);
pd.Print();

private void FontAndLocation(object sender, PrintPageEventArgs e)
{
   e.Graphics.DrawString(textBox1.Text.ToString(), new Font("Bookman Old Style", 18, FontStyle.Bold), Brushes.Black, 20, 95);
   e.Graphics.DrawString(textBox2.Text.ToString(), new Font("Bookman Old Style", 18, FontStyle.Bold), Brushes.Black, 20, 165);
   e.Graphics.DrawString(textBox3.Text.ToString(), new Font("Courier New", 18, FontStyle.Bold), Brushes.Black, 20, 265);
}       

我尝试通过 Internet 进行搜索,但失败了,我还无法解决我的问题 我编写的代码不会在 Draft/dot-matrix(打印机的默认)字体中打印。我们可以在代码中调用打印机或任何可以使用 EPSON-LQ 300 默认字体打印的代码吗?

4

0 回答 0