这段代码工作得很好但是代码用简单字体打印文本但是我想用点阵字体打印它,用点阵打印它的任何代码?
try
{
PrintDocument pd = new PrintDocument();
pd.DefaultPageSettings.PaperSize = new PaperSize("A4", 827, 1170);
pd.PrintPage += new PrintPageEventHandler(this.pd_PrintPage);
pd.Print();
}
catch (Exception ex)
{
MessageBox.Show("پیج کو پرنٹ کرتےوقت ایرر آگیا", ex.ToString());
}
private void pd_PrintPage(object sender, PrintPageEventArgs e)
{
e.Graphics.DrawString(textBox1.Text.ToString(), new Font("BroadWay", 18,
FontStyle.Bold), Brushes.Black, 14,95);
e.Graphics.DrawString(textBox2.Text.ToString(), new Font("BroadWay", 18, FontStyle.Bold), Brushes.Black, 12, 165);
e.Graphics.DrawString(textBox3.Text.ToString(), new Font("BroadWay", 18, FontStyle.Bold), Brushes.Black, 12, 265);
e.Graphics.DrawString(textBox4.Text.ToString(), new Font("BroadWay", 18, FontStyle.Bold), Brushes.Black, 346, 96);
e.Graphics.DrawString(textBox5.Text.ToString(), new Font("BroadWay", 18, FontStyle.Bold), Brushes.Black, 285, 165);
e.Graphics.DrawString(textBox6.Text.ToString(), new Font("BroadWay", 18, FontStyle.Bold), Brushes.Black, 285, 229);
e.Graphics.DrawString(textBox7.Text.ToString(), new Font("BroadWay", 18, FontStyle.Bold), Brushes.Black, 285, 287);
e.Graphics.DrawString(textBox8.Text.ToString(), new Font("BroadWay", 18, FontStyle.Bold), Brushes.Black, 146, 326);
e.Graphics.DrawString(textBox9.Text.ToString(), new Font("BroadWay", 18, FontStyle.Bold), Brushes.Black, 742, 96);
e.Graphics.DrawString(textBox10.Text.ToString(), new Font("BroadWay", 18, FontStyle.Bold), Brushes.Black, 634, 144);
e.Graphics.DrawString(textBox11.Text.ToString(), new Font("BroadWay", 18, FontStyle.Bold), Brushes.Black, 634, 215);
e.Graphics.DrawString(textBox12.Text.ToString(), new Font("BroadWay", 18, FontStyle.Bold), Brushes.Black, 634, 266);
e.Graphics.DrawString(textBox13.Text.ToString(), new Font("BroadWay", 18, FontStyle.Bold), Brushes.Black, 238, 382);
e.Graphics.DrawString(textBox14.Text.ToString(), new Font("BroadWay", 12, FontStyle.Regular), Brushes.Black, 388, 421);
}
代码工作得很好,但我现在只想用点阵字体打印它 尚未完成的。我希望你们中的一个能帮助我 我的打印机是LX-300 + II Impact Printer 我不知道现在该做什么!
答案 0 :(得分:0)
我没有使用阿拉伯语(或任何语言)的经验,但只需将字体设置为" Courier New"通常可以解决这个问题。您可能必须从unicode将文本编码转换为ansi。