@ahsaniqbalsidiqui
I’m trying to create a USPS IMpb. I am receiving an error when trying to produce a GS1 Code128.
I don’t understand how my barcode value is wrong. Please help.
Here is a screenshot of the error.
2020-07-16_8-27-41.png (225.9 KB)
Here is the code:
Private Sub Button7_Click(sender As Object, e As EventArgs) Handles Button7.Click
Dim bchr As String = "9214 8901 1538 5200 5203 11"
Dim bArr() As Byte
'Dim Generator = New Aspose.BarCode.Generation.BarcodeGenerator(EncodeTypes.GS1Code128, bc1 + bc2)
Dim Generator = New Aspose.BarCode.Generation.BarcodeGenerator(EncodeTypes.GS1Code128, "(420)90221(92)0569013951581555550")
Generator.Parameters.Barcode.XDimension.Inches = 0.007F
Generator.Parameters.Barcode.BarCodeHeight.Inches = 0.35F
Generator.Parameters.Barcode.Padding.Left.Inches = 0.17F
Generator.Parameters.Barcode.Padding.Right.Inches = 0.17F
Generator.Parameters.Barcode.Padding.Top.Inches = 0.05F
Generator.Parameters.Barcode.Padding.Bottom.Inches = 0.15F
Generator.CodeText = bchr
Generator.Parameters.Barcode.CodeTextParameters.Alignment = Aspose.BarCode.Generation.TextAlignment.Center
Generator.Parameters.CaptionAbove.Text = "My Barcode"
Generator.Parameters.CaptionAbove.Padding.Top.Inches = 0.05F
Generator.Parameters.CaptionAbove.Visible = True
Generator.Parameters.CaptionAbove.Font.Size.Inches = 0.125F
Generator.Parameters.CaptionAbove.Alignment = Aspose.BarCode.Generation.TextAlignment.Center
Generator.Parameters.CaptionAbove.Font.Style = FontStyle.Bold
Dim mStream = New System.IO.MemoryStream()
Generator.Save(mStream, Aspose.BarCode.BarCodeImageFormat.Bmp)
bArr = mStream.ToArray
Dim ms = New MemoryStream(bArr)
Dim ImageStamp = New ImageStamp(ms)
ImageStamp.Background = True
'ImageStamp.XIndent = 10
'ImageStamp.YIndent = 100
''ImageStamp.Height = 55
''ImageStamp.Width = 350
ImageStamp.Quality = 100
'// Add stamp to particular page
Dim pdfDocument = New Document()
Dim Page = pdfDocument.Pages.Add()
Page.PageInfo.Height = ImageStamp.Height
Page.PageInfo.Width = ImageStamp.Width
Page.PageInfo.Margin = New MarginInfo(0, 0, 0, 0)
Page.AddStamp(ImageStamp)
'dataDir = dataDir + "AddImageStamp_19.4.pdf"
'// Save output document
pdfDocument.Save("C:\Users\nbart\Downloads\test3.pdf")
End Sub