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

Free Support Forum - aspose.com

Barcode Writing Not Working properly


We use license aspose total for Java.
And we are facing this production issue.

We are writing barcode of strings upto a 8 character length in docx.
The problem is the last digit of the barcode is chopped off from the docx. This happens when the program runs in a unix environment.
In my local workspace, there is no such issue

The jar version is aspose-barcode-6.8.0-java.

The attached png would show the barcode being cut off. The actual barcode string should be S0010970

Here is the code snippet

public void writeBarcodeAspose(File file, String contentStreamMimeType, String barcode) throws ActorException {
String barcodeTemp = “”;
BarCodeBuilder bb = new BarCodeBuilder(barcode, Symbology.Code39Standard);
try {
barcodeTemp = File.createTempFile(“barcode”, “.tmp”).getAbsoluteFile().toString();
bb.save(barcodeTemp, BarCodeImageFormat.Bmp);
writeDocument(file, barcodeTemp);
} catch (IOException ioe) {
throw new ActorException(“IO Exception thrown while creating temporary file for barcode”, ioe, “writeBarcodeAspose”, ActorModule.HTML_INPUT_PROCESSING);
} finally{
FileUtils.deleteQuietly(new File(barcodeTemp));

Hi Sreemoyee,

Thank you for contacting support. Please confirm, the last character of the code text is also chopped off before inserting the barcode image in the Word document. You are also using an old version, please download and use the latest version of Aspose.BarCode for Java 7.1.0 and let us know how it goes on your side. We’ll investigate it and reply you accordingly.

Please refer to the download page:

Please also update a highlighted character in the sample code line:
barcodeTemp = File.createTempFile(“barcode”, “.bmp”).getAbsoluteFile().toString();

We’re looking forward to help you.

None of the suggestions helped.

I have replace the barcode jar with aspose-barcode-7.1.0-java

Please look into this urgently.
Again, this happens specifically in the Unix environment.

This is critical as the issue is in production.

Hi Sreemoyee,

Thank you for the inquiry. Please provide us complete your sample code to replicate the problem on our side. The “writeDocument” method part is not available. We would like to add one more thing that the BarCodeBuilder class also offers an overloaded “save” method which allows users to directly write a barcode image in the local space.

Sample code:
bb.save(“C:/AB/test423/barcode.bmp”, BarCodeImageFormat.Bmp);

Please also give it a try in your Unix environment and let us know how it goes on your side.

Here’s the writeDocument method

private void writeDocument(File file, String imageFilePath) throws ActorException {
try {
Document doc = new Document(file.getAbsolutePath());
DocumentBuilder builder = new DocumentBuilder(doc);

insertBarcodeIntoFooter(doc, builder, doc.getFirstSection(), 0, HeaderFooterType.FOOTER_FIRST, imageFilePath, file.getAbsolutePath());
insertBarcodeIntoFooter(doc, builder, doc.getFirstSection(), 0, HeaderFooterType.FOOTER_PRIMARY, imageFilePath, file.getAbsolutePath());

} catch (Exception e) {
throw new ActorException(“Exception thrown while writing the barcode”, e, “writeDocument”, ActorModule.HTML_INPUT_PROCESSING);

And also I am using the overloaded method only.

barcodeTemp = File.createTempFile(“barcode”, “.bmp”).getAbsoluteFile().toString();
bb.save(barcodeTemp, BarCodeImageFormat.Bmp);

I could not understand what is the change you are asking here.

Hi Sreemoyee,

Thank you for posting the source code. We need to be more specific. Please provide the complete details of your working environment. It’ll help us in replicating the error message on our side, please reply to the following questions:

  • What is the version of Unix Operating System and edition, etc.
  • What is the JDK version and update/build number of Java environment?
  • Any other information that you think is necessary.

We’re looking forward to help you.

Here are the details

java -version
java version "1.7.0_72"
Java™ SE Runtime Environment (build 1.7.0_72-b14)
Java HotSpot™ 64-Bit Server VM (build 24.72-b04, mixed mode)

uname -a
Linux gueulvawfr001 2.6.32-431.1.2.el6.x86_64 #1 SMP Sun Nov 24 09:37:37 EST 2013 x86_64 x86_64 x86_64 GNU/Linux

Hi Sreemoyee,

Thank you for providing these details. We’re working over your query and will get back to you soon.

Hi Sreemoyee,

Thank you for being patient. We managed to replicate the problem of missing zero character. We have logged this issue under ticket id BARCODJAVA-33577 in our bug tracking system. Your post has also been linked to this issue. We’ll keep you informed regarding any available updates. We’re sorry for the inconvenience caused.

Can we expect any ETA for this?


Hi Sreemoyee,

Thank you for asking about the resolution. We have just been identified this issue. Our product team requires little time to investigate it. It is not possible for us to share time estimate before the preliminary investigation. We have asked the responsible product team member to take a look at your issue shortly. We’ll let you know once an update is available in this regard.

Hi Imran,

Can you update on the status of the above raised issue asap?


Hi Raghavendra,

The issue has not been analyzed by the product team yet. ETA request has been forwarded to our product team and we will share more details as soon as our product team completes the analysis.

Best Regards,

The issues you have found earlier (filed as BARCODJAVA-33577) have been fixed in this update.

This message was posted using Notification2Forum from Downloads module by Aspose Notifier.