5

i have LQ EPSON 300 Printer

i want to Print some data in Printer's default font

i think it will be possible if we use c# code to print by that printer's default font.

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);
}       

i try to search through Internet but i failed, i could not fix my problem yet The code that i write do not printing in Draft/dot-matrix(Printer's Default) Fonts. can we call printer in code or any code that make it possible to print in EPSON-LQ 300 default font?

Yuval Itzchakov
  • 146,575
  • 32
  • 257
  • 321
sangeen
  • 304
  • 2
  • 3
  • 14
  • I want to print text in text-boxes in draft font which the default font of the my printer – sangeen Sep 28 '14 at 10:35
  • What's the name of that default font? What driver is in use (Epson/Ms)? You're at the mercy of that driver maybe recognizing a font as installed. – H H Sep 28 '14 at 10:45
  • i just want to print the Courier New and Bookman Old Style font text in Dot-Matrix font, it will possible if we write code for print the data through printer's default font – sangeen Sep 28 '14 at 10:52
  • You didn't answer my question: what names does the printer use for its fonts? – H H Sep 28 '14 at 10:53
  • And what is wrong with the current output? – H H Sep 28 '14 at 10:53
  • 3
    You cannot use PrintDocument, you have to send the print commands directly to the printer, bypassing the printer driver. The only way to get fast output from a dot-matrix printer like that. Covered by [this KB article](http://support2.microsoft.com/kb/322091). – Hans Passant Sep 28 '14 at 10:57
  • the printer is : EPSON-LQ 300 – sangeen Sep 28 '14 at 11:04
  • and the the font of that printer is draft – sangeen Sep 28 '14 at 11:05
  • i want to use printer's default fonts which is draft font bcz then it will print fast with using less ink – sangeen Sep 28 '14 at 11:06

0 Answers0