【发布时间】:2019-07-12 08:54:04
【问题描述】:
我正在尝试使用 EPSON TM-T82 ReceiptSA4 热敏打印机(80 毫米卷)打印收据。但是在打印整个字符串时不会将其包裹在下一行中。
Private Sub prnLDocument_PrintPage(ByVal sender As System.Object, ByVal e As System.Drawing.Printing.PrintPageEventArgs) Handles prnLDocument.PrintPage
Dim sInvNo As String = "Explored the DrawString method and couldn't figure out how to do the automatic word wrap. Can you please. After setting the printer name, call IsValid to determine if the printer name is recognized as a valid printer on the system."
Dim InvTitleFont As Font = New Font("Arial", 7, FontStyle.Regular)
e.Graphics.DrawString(sInvNo, InvTitleFont, BlueBrush, 5, 20)
End Sub
Private Sub BillPrint()
Try
prnLDocument.PrinterSettings.PrinterName = "EPSON TM-T82 ReceiptSA4"
prnLPreview.Document = Me.prnLDocument
prnLPreview.ShowDialog()
Catch ex As Exception
MessageBox.Show(ex.ToString())
End Try
End Sub
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
BillPrint()
End Sub
需要帮助如何解决此打印问题。
【问题讨论】:
-
如果你给它一个矩形来打印而不是一个开始打印的点,它会为你换行:DrawString(String, Font, Brush, RectangleF)。
标签: vb.net printdocument