Printing a barcode

Printing the text returned by the Barcode() call may be accomplished by any of the printing techniques available for Visual Studio.NET project. However, probably the most useful approach is to use the DrawString() method in a PrintPage handler as illustrated below, and in the example provided with the components:

 

Visual Basic

Private Sub PrintDocument1_PrintPage(ByVal sender As System.Object, ByVal e As System.Drawing.Printing.PrintPageEventArgs) Handles PrintDocument1.PrintPage
        Dim br As Brush
        Dim ff As New Font(“AZTW”, 8, FontStyle.Regular)
        br = New SolidBrush(Color.Black)
        e.Graphics.PageUnit = GraphicsUnit.Document '
        e.Graphics.DrawString(Aztnet1.barcode(), ff, br, 100.0F, 300.0F)
        ' Indicate that this is the last page to print.
        e.HasMorePages = False
    End Sub

While the PageUnit  setting can be any of the allowed values, the example above uses the highest resolution setting (Document, equivalent to 300 units per inch).

 

More:

Licensing the component