Hello, i have to generate un BarCode : BarCodeBuilder builder = new BarCodeBuilder(); builder.setSymbologyType(“Code128”); builder.setCodeLocation(CodeLocation.None); builder.setCodeText(“Text exemple”); builder.setGraphicsUnit(GraphicsUnit.Pixel); builder.getMargins().set(0); BufferedImage img2 = builder.getCustomSizeBarCodeImage(new Dimension( 50, 50 ), false); But it gives this error “Customize wanted is outside the limits” How can one specify the dimension and what is the value that should not be exceeded ?? If I want to change it GraphicsUnit GraphicsUnit.Millimeter What is the value of the height and width that should not be exceeded ? How does this methode work fonctiongetCustomSizeBarCodeImage ? thank you for your help
Hello,
I posted it to Aspose.BarCode. I’m stuck, I hope I have an answer before tonight.
thank you for your reply
Hello,
What value of width and height that should not be exceeded for genere Code 128? And for QR?
Thank you in advance
I have this error :
class com.aspose.barcode.BarCodeException: Custom size wanted is outside the limits.
builder.setSymbologyType(Symbology.Code128)
builder.setGraphicsUnit(GraphicsUnit.Millimeter);
BufferedImage bufferedImage = builder.getOnlyBarCodeImage ();
BufferedImage image = builder.getCustomSizeBarCodeImage(new Dimension(bufferedImage.getWidth() *50, bufferedImage.getHeight();50), false);
GraphicsUnit , what the calculation of dimension ??
thanks for your help
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);
i have this error When you run this code :
class com.aspose.barcode.BarCodeException: Custom size wanted is outside the limits.
com.aspose.barcode.j.a(Unknown Source)
com.aspose.barcode.j.a(Unknown Source)
com.aspose.barcode.j.a(Unknown Source)
com.aspose.barcode.BarCodeBuilder.a(Unknown Source)
com.aspose.barcode.BarCodeBuilder.getCustomSizeBarCodeImage(Unknown Source)
I use Aspose.BarCode : Version 6.8.0
Waiting for your response as soon as possible, thank you very much .