Problem with Barcode Generator, the Text disappears for 90° rotated CODE 128

Currently we use this file guntherbarcode.docx (54,4 KB)
to test Aspose Words Java Barcode.

At left side, there is a vertical align CODE128 barcode. However the text of this vertical barcode has not been displayed.

So is the actual visual result. gunther-barcode-out.pdf (116,3 KB)

After long time debug, it could be a problem of our CustomBarcodeGenerator.
Tomorrow we will make further debug, and keep you informed.

@zwei Please note, Barcode image generation is our of Aspose.Words scope and is performed by Aspose.Barcode, or other barcode generation tool used in your implementation of IBarcodeGenerator. I have played with IBarcodeGenerator implemetation provided in the code examples and it looks like the problem is with barcode scaling. If add the following:

if (generator.getBarcodeType().equals(EncodeTypes.CODE_128)) {
    final float CODE_128_SCALE = 0.25f;
    generator.getParameters().getBarcode().getXDimension().setInches(generator.getParameters().getBarcode().getXDimension().getInches() * CODE_128_SCALE);
    generator.getParameters().getBarcode().getBarHeight().setInches(generator.getParameters().getBarcode().getBarHeight().getInches() * CODE_128_SCALE);
}

Barcode looks a bit better, but still not the same as in MS Word: out.pdf (72.5 KB)

I would suggest you to consult with Aspose.Barcode team regarding the barcode scaling.

1 Like

Thank you very much!

1 Like