we are testing Aspoce.Cells and Aspose.barcode and we have a little problem of “noise” in the barcode.
This is the “good” barcode printing with high resolution printer : barcode good 150.jpg (582.6 KB)
The resolution of the barcode is 150.
This is the “bad” barcode printing with label printer (squix 4.3/200p) with resolution max of 203px barcode bad 50 15.jpg (492.9 KB)
The resolution of the horizontal barcode is 50 and 15 for the vertical.
We can’t get a better result…
Have you an idea for our problem ?
We want to be sure that will work before buy the licence.
Code :
Dim STR_xls As String = "C:\programmes\scaldis\xls\Etiquette_Paquet_ISO_PAQ3.xlsm"
Dim sheet As Worksheet
Dim activeCell As Cell
Dim XLSAPP_imp = New Workbook(STR_xls)
Dim barcode As New MemoryStream
Dim barcodeVertical As New MemoryStream
Using generator As New BarCodeGenerator(EncodeTypes.Interleaved2of5, STR_PaqNumber)
generator.CodeTextStyle.Location = CodeLocation.None
generator.Resolution = 150
generator.Save(barcode, BarCodeImageFormat.Jpeg)
generator.RotationAngle = 90
generator.Save(barcodeVertical, BarCodeImageFormat.Jpeg)
End Using
sheet = XLSAPP_imp.Worksheets().Item("Etiquette_CD")
activeCell = sheet.Cells("B5")
activeCell.Value = $"PAQ N° {vbCrLf}{STR_PaqNumber}"
activeCell = sheet.Cells("B9")
sheet.Pictures.Add(1, 10, 11, 12, barcodeVertical)
activeCell = sheet.Cells("K3")
sheet.Pictures.Add(9, 1, 11, 9, barcode)
activeCell = sheet.Cells("B8")
activeCell.Value = STR_PaqNumber
Dim options As Aspose.Cells.Rendering.ImageOrPrintOptions = New Aspose.Cells.Rendering.ImageOrPrintOptions()
options.PrintingPage = PrintingPageType.[Default]
Dim sr As SheetRender = New SheetRender(XLSAPP_imp.Worksheets().Item("Etiquette_CD"), options)
sr.ToPrinter(Configs.PrinterName)
Can you please specify why you need low resolution?
We recommend to set barcode width and height properties in order to get good quality barcode but restricted in pixels size like as given below:
We have generated the barcodes with provided values and found no issue in it. Please have a look and share your feedback simple.jpg (15.8 KB) barcodeVertical.jpg (17.7 KB).
Moreover, it is requested to kindly mention what is lacking in it. You may also try by setting height and width in inches as well.
It is requested to kindly share your complete code supporting the defined process so that we could investigate either it is the issue of Aspose.BarCode or Aspose.Cells.
We are unable to reproduce this issue using Aspose.BarCode for .NET 18.12 version. Please find the code file vb.zip (653 Bytes) and test it at your end. It is also requested to try to save Barcode image then print it manually not by sending directly to printer and share your feedback with us.
Yes, we don’t have any problems when we open the Excel file on the computer.
But when we print with a printer of 203dpi max, the vertical barcode is always bad quality. However, with a printer of 600dpi, the quality is better.
With the actual generation of barcode (using a font instead of picture), the impression’s quality is good.
However, we want to change our solution to avoid the Excel utilisation and this font.
We have also the problem when we print manually the barcode from jpg format.
For generating barcode, you do not need Excel and it can be generated independently using our API. You may export it to image format, it totally depends upon your requirement.
Regarding printing barcode, if the generated barcode in JPG format is correct and the issue is with the printer then we may only suggest to change the printer.
Moreover, please elaborate the issue with font in detail and it would be great if you could share sample image.