0
votes

I am having issues when trying to print from a web application using ASP.NET C# to a Epson TM-U220 receipt printer. My program is printing to the receipt printer but after about 60 lines of printing..the printer just cuts off. I am trying to figure out how to adjust the height of this printer but can't seem to get it.

I ran some tests on the server using notepad to make sure it was the application. I made a 100 line test document in notepad and that printed just fine to the printer. It seems to cut off page 2 when printing from the web application and I am assuming it is because of the height.

Below is a sample of the code. Any help is appreciated!

PaperSize psize = new PaperSize("Custom", 100, 200);
doc.DefaultPageSettings.PaperSize = psize;
doc.DefaultPageSettings.PaperSize.Height = doc.DefaultPageSettings.PaperSize.Height / 2; 
//doc.DefaultPageSettings.PaperSize.Width = 520;
doc.PrinterSettings.PrinterName = Session["printerName"];// set the printer name by ID
doc.PrintPage += new PrintPageEventHandler(this.PagePrint);
doc.Print(); 
1

1 Answers

0
votes

Turns out it was an issue with the print driver.

Added the following line:

doc.DefaultPageSettings.PaperSize.Height