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

Free Support Forum - aspose.com

Align Data Matrix code with its text


Hello there,

I am trying your Java Barcode software and am able to print the 2D Matrix code but I need to align the barcode with the text which I am printing. I have attached the JPG image. I want thebarcode and the text to be left aligned together now it is not,as you see in the image. Appreciate your help.

cheers
Zulf

Hi Zulf,

You cannot align the code text however you can align the caption. Please use the following code to get your expected output.

builder.setCodeLocation(CodeLocation.None);

builder.getCaptionBelow().setVisible(true);

builder.getCaptionBelow().setText(builder.getCodeText());

builder.getCaptionBelow().setTextAlign(StringAlignment.Near);

Best Regards,


Hi Muhammad,

Thanks this resolved the issue.

regards
Zulf