Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/272.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/.net/23.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何在打印机中打印';使用C#代码的默认字体?_C#_.net_Printing_Non Ascii Characters_Dot Matrix - Fatal编程技术网

如何在打印机中打印';使用C#代码的默认字体?

如何在打印机中打印';使用C#代码的默认字体?,c#,.net,printing,non-ascii-characters,dot-matrix,C#,.net,Printing,Non Ascii Characters,Dot Matrix,我有LQ爱普生300打印机 我想用打印机的默认字体打印一些数据 我认为如果我们使用c代码以打印机的默认字体打印,这是可能的 PrintDocument pd = new PrintDocument(); pd.DefaultPageSettings.PaperSize = new PaperSize("A4", 950, 555); pd.PrintPage += new PrintPageEventHandler(this.FontAndLocation); pd.Print(); priv

我有LQ爱普生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);
}       
我试图通过互联网搜索,但我失败了,我还不能解决我的问题 我编写的代码不会以草稿/点阵(打印机的默认)字体打印。
我们可以调用代码中的打印机,还是可以使用EPSON-LQ 300默认字体打印的任何代码?

我想用草稿字体打印文本框中的文本,我的打印机的默认字体是什么?默认字体的名称是什么?正在使用哪种驱动程序(爱普生/毫秒)?你的命运取决于驱动程序可能会识别安装的字体。我只想用点阵字体打印Courier New和Bookman Old Style字体文本,如果我们通过打印机的默认字体编写打印数据的代码,则可能您没有回答我的问题:打印机的字体使用什么名称?您不能使用PrintDocument,您必须绕过打印机驱动程序直接将打印命令发送到打印机。这是从那样的点阵打印机获得快速输出的唯一方法。由……覆盖。