我正在开发一个打印产品列表的应用程序。我正在寻找信息并使用此代码进行打印:
e.Graphics.DrawString("Products", printFont, System.Drawing.Brushes.Black, 25, YPosition)
YPosition += 80
e.Graphics.DrawString(fechaHora, printFont, System.Drawing.Brushes.Black, 25, YPosition)
YPosition += 40
e.Graphics.DrawString("Nmp: " + npedido, printFont, System.Drawing.Brushes.Black, 25, YPosition)
YPosition += 40
If special <> "" Then
e.Graphics.DrawString(special, printFontTitulo, System.Drawing.Brushes.Black, 425, YPosition)
YPosition += 40
End If
e.Graphics.DrawString("==============================================", printFont, System.Drawing.Brushes.Black, 25, YPosition)
YPosition += 40
e.Graphics.DrawString("==============================================", printFont, System.Drawing.Brushes.Black, 25, YPosition)
YPosition += 40
For i = 0 To lst_products.Items.Count - 2
e.Graphics.DrawString(lst_products.Items.Item(i) + " (" + lst_price.Items.Item(i) + ")", printFont, System.Drawing.Brushes.Black, 25, YPosition)
YPosition += 40
Next
当产品列表包含20种产品时,问题就出现了,纸张的高度与A4类似,并且停止打印。
我不知道问题是打印机还是我的代码。
感谢您的帮助。