2012-10-21 3 views
2

.net을 사용하여 인보이스 발행 후 pos 청구서를 인쇄하는 슈퍼마켓 용 시스템을 개발 중입니다..net pos 프린터 롤 인쇄

지폐 인쇄의 경우 .net에서 System.Drawing.Printing을 사용하고 있습니다.

항목 목록이 너무 길어 한 페이지 제한을 늘릴 때 문제가 발생했습니다. 프린터는 첫 번째 페이지 만 인쇄하고 용지 만 자릅니다.

다음은 내가 사용한 인쇄용 코드 샘플입니다. 이 문제를 해결하도록 도와주세요.

Private Sub printInvoice() 

    Dim printDocument As New PrintDocument 
    Dim printController As New StandardPrintController 
    printDocument.PrintController = printController 
    AddHandler printDocument.PrintPage, AddressOf PrintDocumnet_Event 
    printDocument.Print() 

End Sub 

Public Sub PrintDocumnet_Event(ByVal sender As Object, ByVal e As PrintPageEventArgs) 
    Try 
     Dim dataFont As Font = New Font("Courier New", 9, FontStyle.Bold) 
     Dim leftMargin As Integer = 15 
     Dim topMargin As Integer = 65 


     For Each invoiceRow As DataRow In dtInvoice.Rows 
      Dim code As String = invoiceRow("Item_Code").ToString.Trim 
      Dim name As String = invoiceRow("Print_Name").ToString.Trim 
      Dim price As String = String.Format("{0:0.00}", Double.Parse(invoiceRow("Price"))) + "x" 
      Dim qty As String = String.Format("{0:0.###}", Double.Parse(invoiceRow("Qty"))) 
      Dim amont As String = String.Format("{0:0.00}", Double.Parse(invoiceRow("Amount"))) 
      Dim discount As String = String.Format("{0:0.00}", Double.Parse(invoiceRow("Discount"))) 


      e.Graphics.DrawString(String.Format("{0,-8}", name), dataFont, Brushes.Black, leftMargin, topMargin) 
      topMargin += 15 
      e.Graphics.DrawString(String.Format("{0,-10} {1,7} {2,5} {3,8}", code, price, qty, amont), dataFont, Brushes.Black, leftMargin, topMargin) 
      topMargin += 20 
     Next 
End Sub 
+0

어떤 POS 프린터를 말하는가? 프린터를 제어하기위한 ESC 코드가 더 쉬울 수도 있습니까? – t0mm13b

+0

EPSON TM-T81 POS 프린터를 사용하고 있습니다. 그리고 인쇄가 끝나면 자동으로 용지를 자릅니다. 여기서 문제는 프린터가 한 페이지를 인쇄 한 후 용지를 자르는 것입니다. 나머지 페이지는 인쇄되지 않습니다. – las

+0

우선, 나는 당신이 꽤 오래 할 수 있어야만하는 롤이기 때문에, 당신의 페이지 길이 설정이 무엇인지를 두 번 확인할 것입니다. TM-181 설명서를 찾을 수 없지만 다른 Epson 프린터는 1289 인치를 초과했습니다. 하나의 PrintDocument를 사용했는지 확인하십시오. –

답변

1

모두를위한 Thanx. 해결책을 찾았습니다. 항목 목록에 따라 페이지 높이를 확인하고 페이지가 초과하면 다음을 추가해야했습니다.

e.HasMorePages = True