We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

How to change the thickness of QR code or barcode cells or lines

I have been asking various questions in the last few days.
We apologize for the inconvenience.

Is it possible to change the thickness of cells and lines with a QR code or barcode?
When printed, it may be thicker than the original data, so it is often adjusted by the cell size and line thickness.
Is it possible with Aspose.Barcode?

For barcodes, does the content of this document correspond to that?

I will attach a sample image.

For QR, I don’t know unless I enlarge it, but since each cell is not the perfect size, it is a little small, so you can see that there is a space between cells.

Best regard.LAL-QR.pdf (19.1 KB)
ean128_cmyk_Hosei.pdf (73.2 KB)

@yuya,
You may try to use the following sample codes for controlling the cell size and thickness of lines using XDimension property. If it does not fulfill the requirement, share your desired output generated by some third-party tool along with the steps to generate it. We will observe the requirement here and share our feedback accordingly.

 private static void GenerateBarCode() throws IOException
    {

        BarcodeGenerator generator = new BarcodeGenerator(EncodeTypes.CODE_39_STANDARD, "*12345*");
        
        generator.getParameters().setAutoSizeMode(AutoSizeMode.NONE);

        generator.getParameters().getImageHeight().setMillimeters(12.003889f);
        generator.getParameters().getBarcode().getXDimension().setMillimeters(0.2f);

        generator.getParameters().getBarcode().getPadding().getLeft().setPixels(0);
        generator.getParameters().getBarcode().getPadding().getTop().setPixels(0);
        generator.getParameters().getBarcode().getPadding().getRight().setPixels(0);
        generator.getParameters().getBarcode().getPadding().getBottom().setPixels(0);
        generator.getParameters().getCaptionBelow().getFont().setStyle(FontStyle.REGULAR);

        generator.save("GenerateBarcode.jpg");
    }
    private static void GenerateQRCode() throws IOException
    {
        BarcodeGenerator generator = new BarcodeGenerator(EncodeTypes.QR, "1234567");
        generator.getParameters().getBarcode().getXDimension().setPixels(2);
        generator.getParameters().getBarcode().getPadding().getLeft().setPixels(20);
        generator.getParameters().getBarcode().getPadding().getTop().setPixels(20);
        generator.getParameters().getBarcode().getPadding().getRight().setPixels(20);
        generator.getParameters().getBarcode().getPadding().getBottom().setPixels(20);
        generator.getParameters().setBackColor(java.awt.Color.GREEN);
        generator.getParameters().getBarcode().setBarColor(java.awt.Color.RED);
        generator.getParameters().getBarcode().getCodeTextParameters().setAlignment(com.aspose.barcode.generation.TextAlignment.CENTER);
        generator.getParameters().getBarcode().getCodeTextParameters().setLocation(CodeLocation.ABOVE);
        generator.getParameters().getBarcode().getCodeTextParameters().setColor(java.awt.Color.RED);
        //save barcode
        generator.save("QRCode.png", BarCodeImageFormat.PNG);

    }

Hi, thank you for the reference source.

I tried it, but isn’t this something that changes the quiet zone, etc.?

For the time being, I will add only about QR,
As you can see in the attached image, the size of each cell is smaller.
I don’t think the cells are in contact with each other.
This is what I want to do.

I also attach the source that does this.
It seems that my colleague is creating the QR this way.

please confirm.

screenshot_2021-10-20_103523.png (1000 Bytes)
qrencode-4.0.0.zip (536.2 KB)

@yuya,
We are working on it and will share our comments soon.

@yuya,
Could you please provide details about your environment? We have to log a ticket and need to know whether you need the solution in a .NET environment or C++ based solution is required.

I think you speak about BarWidthReduction which is used for ink printer fix (inks floating).

string filename = @"d:\save\rec\test.png";

var generator = new BarcodeGenerator(EncodeTypes.QR, "Some Text");
//resolution, currently 300 dpi
generator.Parameters.Resolution = 300;
//qr cell size, currently 1mm
generator.Parameters.Barcode.XDimension.Millimeters = 1f;
//generator.Parameters.Barcode.XDimension.Pixels = 10f;
//reduces black filling of the cells
//this is used mostly for ink printers
generator.Parameters.Barcode.BarWidthReduction.Millimeters = 0.2f;

generator.Save(filename, BarCodeImageFormat.Png);

@yuya,
We have further discussed your issue and observed that you want to control the printing so that no ink is spread while printing. If this is the case, you should try BarWidthReduction parameter as shared by @alexander.gavriluk above.

If it does not fulfill your requirement, could you please explain why exactly do you need this white space between the cells? Also, check if you are looking for QR art as given below.
http://qrcodes.com.ua/wp-content/uploads/2012/08/QR-Code-Art-Aug24.jpg

I’m currently using .NET.

Hi. Thank you for your reply.

I tried using BarWidthReduction.
I’d like to know the specifications of this, but if there are adjacent cells vertically and horizontally, do they mean that the cells are connected?gs1_qr_cmyk.pdf (485.7 KB)

Please have a look as I will attach the part I made.
In the case of the above specifications, is it not possible to connect diagonally adjacent objects? So there is white in the middle of the 2x2 square.

Is this correct?

Hi. Thank you for your reply.

I tried using BarWidthReduction, but I couldn’t get the space between adjacent cells like your sample.
Is there any option other than BarWidthReduction?

The QR sample I made using BarWidthReduction is attached to the previous reply. please confirm.

Yes BarWidthReduction is created for ink printers to reduce inks floating. To avoid something like this:

What do you want is called QR Art and currently is not realized in our library.

Do you require implemented QR Art engine?

1 Like

Thank you for your reply many times.

I also checked with the printing department.
There seems to be no problem with this output. When actually printing, unlike my sample above, there was no noticeable blank space, and it seemed that I really wanted to make it smaller by a few millimeters.

QR art is not supported, isn’t it? OK.
I apologize for the inconvenience because I only understood how to do it like QR art.
BarWidthReduction seems to be enough.

Best regard !

@yuya,
Thank you for the feedback. Yes, you are right that QR art is not supported and is not in our plans yet.