New User? Sign Up  |  Sign In  |  Help
Barcode support and
tutorials from IDAutomation
and the community.
Click for the BBB Business Review of this Computers Hardware, Software & Services in Tampa FL
Resolved Questions

Freeze with java Barcode Component UCC128

I'm using the IDAutomation Java Barcode Component version 2017 and Java 17, we face a freeze of our application. The same problem is described here: https://support.idautomation.com/Java-Barcode-Package/Infinite-loop-in-Java-Barcode-Component-paint-UCC128/_3757 but we failed to implement the proposed workaround. I opened a new ticket with our active Level 2 Support. We have a very strategic customer impacted by this infinite loop problem with Code 128.


Attachments:

10-27-23     1.1 year(s) ago    

  Report Abuse

 

Brant

Best Answer

Refer to the attached GS1ImageExamle.zip, we were able to run the code without any problems. If you can run this code without any problems it proves that our library is working correctly. If this does not run in your environment, there is something wrong with that system because it runs correctly on our system. This example was run on Windows 11 with Java 8 update 391. LinearBarCode.jar is dated 3-24-2023 - this is the version in the download.
Can you try the example on another system and if it works there; then use a process of elimination to find the source of the issue?

Posted 1.1 year(s) ago

(0)
(0)
  Report Abuse
 
Find Interesting
 
Email to Others
 
Bookmark
 
Subscribe to Answer Alert
No comments yet.     Be the first to comment.
Other Answers (6)
Hello,

We modified the code you proposed. With our modification and the version of the library we have, we face an infinite loop.
Here is the modified code :

import com.idautomation.linear.BarCode;
import com.idautomation.linear.encoder.barCodeEncoder;

class BarCodeSnippet3
{
public static void main(String[] args)
{
BarCode bc = new BarCode();
bc.processTilde = true;
// bc.code = "~202013456789012345717991231";
bc.code = "~2023760";
barCodeEncoder bce = new barCodeEncoder(bc, "GIF", "GS1Test.gif");
System.exit(0);
}


What's wrong?

Posted 1.1 year(s) ago

(0)
(0)
   Report Abuse
Please try this code to prove that our library is working correctly:

import com.idautomation.linear.*;
import com.idautomation.linear.encoder.*;
class CreateImageExample {
public static void main(String[] args) {
BarCode bc = new BarCode();
bc.processTilde = true;
bc.code = "~202013456789012345717991231";
barCodeEncoder bce = new barCodeEncoder(bc, "GIF", "GS1Test.gif");
System.exit(0);
}
}

Posted 1.1 year(s) ago

(0)
(0)
   Report Abuse
Thanks for giving us more accurate information.

The behavior of the library changed when we upgraded to Java 17 and Java Barcode Component version 2017.
We subscribed to Level 2 Support to be helped.

Your answer "Try to run the example included in the download. If this example works, then use a process of elimination to define the source of the issue." is rather vague and doesn't help.

Thanks in advance.

Posted 1.1 year(s) ago

(0)
(0)
   Report Abuse
Try to run the example included in the download. If this example works, then use a process of elimination to define the source of the issue.

Posted 1.1 year(s) ago

(0)
(0)
   Report Abuse
A modified version of the snippet.

No way to have something working.



--------------------


package fr.infologic.superviseur.client.drivers.global;

import java.awt.image.BufferedImage;

import com.idautomation.linear.BarCode;

public class BarCodeSnippet2
{
private static final int WIDTH = 800;
private static final int HEIGHT = 20;

private static final String code = "3760";

public static void main(String[] args)
{
boolean processTilde = true;
paintBarCode(processTilde, BarCode.CODE128, "~202"+code);
}

private static void paintBarCode(boolean processTilde, int barType, String code)
{
final BarCode barCode = new BarCode();
barCode.barType = barType;
barCode.code = code;
barCode.setProcessTilde(processTilde);

final BufferedImage bufferedImage = new BufferedImage(WIDTH, HEIGHT, BufferedImage.TYPE_INT_RGB);

System.out.println("-------------------");
System.out.println("start paint " + processTilde + "-" + barType + "-" + code);
barCode.paint(bufferedImage.getGraphics());
System.out.println("end paint");
}

}

Posted 1.1 year(s) ago

(0)
(0)
   Report Abuse
From the code you sent, it seems you need to set ApplyTilde to True and use the CODE128 function and not the UCC128 because in some situations the UCC128 function can cause problems. Use ~202 for each FNC1, For example:
processTilde = true;
paintBarCode(processTilde, BarCode.CODE128, "~202"+code);

Posted 1.1 year(s) ago

(0)
(0)
   Report Abuse
Email this question link to friends
You must enter an email address, if name is entered or vice-versa for each friend.
Friend #1 -
Friend #2 -
Friend #3 -
Friend #4 -
Friend #5 -
  Your comment on this question
  |         |  
bold  italic  underline  strike       big  small       superscript  subscript 
  Allows to add a link. Added links would only be converted to actual clickable link, when the domain of the link is white-listed by administrator.
Caption :
Link URL :
(Must starts with "http://")
Add  |   Cancel
  Allow to insert an image. Must be among the following file types - *.jpg, *.gif, *.png & *.bmp.
Image Url :   Upload New
(Image url must always starts with " http:// ")
Width : pixels
(Must not be greater than 450px. Enter 0px for no resize)
Add  |   Cancel
  Allow to insert YouTube video. Insert the video embed code.
Embed Code :
Add  |   Cancel
Up to 5000 Characters are allowed. Current Count: 0
  Your comment on this answer
  |         |  
bold  italic  underline  strike       big  small       superscript  subscript 
  Allow you to add a link. Added links would only be converted to actual clickable link, when the domain of the link is white-listed by administrator.
Caption :
Link URL :
(Must start with "http://" or "https://")
Add  |   Cancel
  Allow to insert an image. Must be among the following file types - *.jpg, *.gif, *.png & *.bmp.
Image Url :   Upload New
(Image url must always start with "http://" or "https://")
Width : pixels
(Must not be greater than 450px. Enter 0px for no resize)
Add  |   Cancel
  Allow to insert YouTube video. Insert the video embed code.
Embed Code :
Add  |   Cancel
Up to 5000 characters are allowed. Current Count: 0

You may answer and comment on any thread according to the Terms and Conditions.

 © Copyright 2021 IDAutomation.com, Inc., All Rights Reserved. Legal Notices.

 Barcode Fonts | Components | Scanners | Support | Contact Us
Training Videos on YouTube Join us on Google Plus Join us on LinkedIn Follow us on Twitter Like us on Facebook