Barby gem printing - fuzzy barcode image

Anyone who uses Barbie Stone ( https://github.com/toretore/barby ) to create and print barcodes? I create and print png barcode files and they come out fuzzy. Please note that the generated PNG files look great even when zoomed in on the bars, but when they are printed, the borders are not clear. I print barcodes of the same format and format that I received elsewhere on one printer, and they look beautiful and crisper.

Here is the code I use if anyone has any ideas how I can make it look better. It is not used at the moment, because the scanner cannot read it.

I noticed that the created png has 72 dpi, and there seems to be no way to make it higher. This may or may not have anything to do with it.

require 'barby' require 'barby/barcode/code_128' require 'barby/outputter/png_outputter' fnsku = 'ABC123' barcode = Barby::Code128A.new(fnsku) outputter = Barby::PngOutputter.new(barcode) outputter.height = 50 outputter.xdim = 1 filepath = 'barcode.png' File.open(filepath, 'w'){ |f| f.write outputter.to_png } 

Thanks in advance.

+7
ruby ruby-on-rails printing barcode barcode-printing
source share
1 answer

The problem was the PNG output. The solution was to write directly to PDF.

I donโ€™t know why PNG output didnโ€™t cut.

0
source share

All Articles