我正在尝试使用标签机(argox x-2300e)打印一个代码39,所以代码是这样的(我删除了所有内容,仅打印条形码进行测试):
Imports System.ComponentModel
Imports System.Drawing.Printing
Public Class Form1
Dim linea1 As String = "*A0-121244$K0001196AA-UK*"
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
Dim psz2 As New Printing.PaperSize
psz2.RawKind = Printing.PaperKind.Custom
psz2.Width = 217
psz2.Height = 314
PrintDocument2.DefaultPageSettings.PaperSize = psz2
PrintDocument2.DefaultPageSettings.Margins = New Margins(0, 0, 0, 0)
PrintDocument2.DefaultPageSettings.Landscape = False
PrintDocument2.PrinterSettings.Copies = 1
PrintDocument2.PrinterSettings.PrinterName = "\\ETIC1\Argox X-2300E series PPLB"
PrintPreviewDialog2.Size = New System.Drawing.Size(500, 750)
PrintPreviewDialog2.ShowDialog()
End Sub
Private Sub PrintDocument2_PrintPage(sender As Object, e As PrintPageEventArgs) Handles PrintDocument2.PrintPage
Dim drawFormat As New StringFormat
drawFormat.Alignment = StringAlignment.Center
e.Graphics.ScaleTransform(1, 3)
e.Graphics.DrawString(linea1, New Font("IDAHC39M Code 39 Barcode", 6, FontStyle.Regular), Brushes.Black, New Rectangle(0, 2, 217, 50), drawFormat)
e.Graphics.DrawString(linea1, New Font("Free 3 of 9", 14, FontStyle.Regular), Brushes.Black, New Rectangle(0, 55, 217, 50), drawFormat)
e.Graphics.ScaleTransform(1, 1 / 3)
e.Graphics.DrawLine(New Pen(Brushes.Black, 0.5), New Point(15, 250), New Point(202, 250))
End Sub
Private Sub PrintPreviewDialog2_Closing(sender As Object, e As CancelEventArgs) Handles PrintPreviewDialog2.Closing
Application.Exit()
End Sub
End Class
现在,问题是这样的:
我打印了标签,但是我们的扫描仪无法读取条形码(扫描仪与我们最大的客户相同)
使用大小为16的“ 3到9的自由字体”是每次都能读取的代码的最小大小,但这超出了标签的大小。
使用“ IDAHC39M Code 39 Barcode”(IDAHC39M代码39条码)字体时,它的大小必须至少为8以便可读。 (但这仍然超出了标签的尺寸)
我在2个代码下画了一条线,它表示使用打印机本身随附的标签软件生成的相同条形码的宽度,即使它较小,也可以完全读取 标签是55mm x 80mm
如何使标签内的代码具有可读性?我想念什么?