Hi,
I am new for vb.net. I am using 2010 on windows 7 operation system.
I need make a report and it send to directly printer.(Without Print Dialog Box). I tried it and one problem came. After give the print command printer start the printing process but black paper coming out. What is the Problem.
I am used PrintDocument and printpreviewcontrol.
Thanks and Regads.
I am new for vb.net. I am using 2010 on windows 7 operation system.
I need make a report and it send to directly printer.(Without Print Dialog Box). I tried it and one problem came. After give the print command printer start the printing process but black paper coming out. What is the Problem.
VB.NET:
Imports System.Drawing.Printing
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdPrint.Click
'Create Custom Document
PrintDocSticker.DefaultPageSettings.PaperSize = New System.Drawing.Printing.PaperSize("LblSticker", 600000, 400000)
PrintPreviewC.Document = PrintDocSticker
PrintDocSticker.Print()
End Sub
Private Sub PrintDocSticker_PrintPage(ByVal sender As Object, ByVal e As System.Drawing.Printing.PrintPageEventArgs) Handles PrintDocSticker.PrintPage
Dim MyRect As Rectangle
Dim LargeTitle As Font = New Drawing.Font("Arial", 14000)
Dim LargeTitleValue As Font = New Drawing.Font("Arial", 22000, FontStyle.Bold)
Dim LotNumberFont As Font = New Drawing.Font("Arial", 72000, FontStyle.Bold)
Dim BaseFont As Font = New Drawing.Font("Arial", 12000, FontStyle.Bold)
Dim BaseValueFont As Font = New Drawing.Font("Arial", 10000)
Dim BarCodeFont As Font = New Drawing.Font("Free 3 of 9 Extended", 31000)
MyRect = New Rectangle(25000, 25000, 550000, 350000)
e.Graphics.DrawRectangle(Pens.Black, MyRect)
'Count & Product
e.Graphics.DrawString("COUNT & PRODUCT :", LargeTitle, Brushes.Black, 50000, 50000)
e.Graphics.DrawString("Variable Value", LargeTitleValue, Brushes.Black, 260000, 39500)
end Sub
I am used PrintDocument and printpreviewcontrol.
Thanks and Regads.
Last edited by a moderator: