As you are using Aspose.BarCode APIs, so you have posted your query in the wrong forum. I am now moving your thread to respective forum and one of my fellow colleagues from Aspose.BarCode team will help you soon there.
This is to update you that you can adjust barcode image size and can set unit of the barcode image through code. There is no implicit/default restriction on maximum height & width except if there is any in the specification e.g. Code 128.
Furthermore we are unable to reproduce the issue at our end. We are attaching the sample output barcode image and sample code for your reference.
// Generate the bar code BarCodeBuilder builder = new BarCodeBuilder(); // Set symbology type builder.setSymbologyType(com.aspose.barcode.Symbology.Code128); // Set the code text builder.setCodeText("12345"); // Set the code text location builder.setCodeLocation(CodeLocation.None); // Set graphics unit builder.setGraphicsUnit(com.aspose.barcode.GraphicsUnit.Millimeter); // Set margins builder.getMargins().set(0); // Get BufferedImage with exact bar code only java.awt.image.BufferedImage img = builder.getOnlyBarCodeImage(); // Allows to set size for whole picture with bar code inside java.awt.image.BufferedImage tt = builder.getCustomSizeBarCodeImage(new java.awt.Dimension(img.getWidth() * 50, img.getHeight() * 50), false); // Saving the buffered image java.io.File outputfile = new java.io.File("custombarcode.png"); javax.imageio.ImageIO.write(tt, "png", outputfile);
Follow the links for details on custom width, barcode image unit size etc:
Hope that above information helps you to generate the barcode image of custom size. Feel free to contact us in case of any query or comments along with your sample code project demonstrating the issue and details about what is expected as output.