How to print in printer fonts by default using C # code?

I have a LQ EPSON 300 printer

I want to print some data in the default font for the printer

I think it will be possible if we use C # code to print with this default font for the printer.

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'm trying to search over the Internet, but I couldn’t, I still couldn’t fix my problem. The code that I write does not print in draft / dot-matrix fonts (default printer). Is it possible to call the printer in code or any code that allows printing in EPSON-LQ 300 font by default?

+5
source share

Source: https://habr.com/ru/post/1203562/


All Articles