2
此代碼運行良好,但代碼以簡單的字體打印文本,但我想打印它點陣字體,任何代碼打印點陣?如何從c#中打印點陣字體文本?
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衝擊式打印機 我不知道該怎麼做!