5

I am trying to migrate my iText dependency to a higher version. Before I used itextpdf-5.4.2.jar and itext-1.3.1.jar. Now I have migrated to itextpdf-5.5.10.jar and itext-4.2.1.jar.

After this upgrade, my PDF no longer prints barcodes. Barcodes worked perfectly with the earlier versions.

  1. Is there anything I am missing regarding this jar migration?
  2. What is the difference between these two jars?

My BarCode sample code:

Barcode39 code128 = new Barcode39();            
code128.setGenerateChecksum(true);            
code128.setCode(Id);  
code128.setBarHeight(50.0f);
code128.setX(30.0f);
Amedee Van Gasse
  • 7,280
  • 5
  • 55
  • 101
G.S.Shriram
  • 91
  • 1
  • 8
  • Possible duplicate of [What is the difference between lowagie and iText?](http://stackoverflow.com/questions/13515210/what-is-the-difference-between-lowagie-and-itext) – Amedee Van Gasse Jan 24 '17 at 10:41

1 Answers1

13

I see 3 questions. I will answer only 2 of them, for the third question you need to open a new topic on Stack Overflow.

These are your questions as I see them:

  1. What is the difference between itext and itextpdf?
  2. What am I missing in my dependency upgrade?
  3. Why have my barcodes stopped working?

1. Difference between itext and itextpdf

tl;dr: there is no difference!

I would also like to refer you to these duplicate questions:

Longer answer:

iText is a PDF library for Java which was originally developed by Bruno Lowagie. You can still see that in the old versions of iText (prior to 5.0.0), the packages are called com.lowagie.* Some years ago, Bruno Lowagie founded a company around his iText product, iText Software. At the time the domain name itext.com was not available, so he registered itextpdf.com. Starting from version 5.0.0, the package names were renamed from com.lowagie.* to com.itextpdf.*. It is a common practice to name your packages after the reverse of your domain name.

As a crude rule of thumb:

  • Versions 1.x.x and 2.x.x = com.lowagie.* = developed by Bruno Lowagie
  • Versions 5.x.x and 7.x.x = com.itextpdf.* = developed by iText Software
  • Versions 4.x.x = released by someone unknown, unrelated to iText Software. Not an official release. Do not use.

2. What is missing in the dependency upgrade

  • Only use version 5.5.10.
  • Delete all other versions.
  • Check your code for import com.lowagie and replace with import com.itextpdf.
  • Fix any compilation errors.

3. Why have your barcodes stopped working

I don't know. Open a new topic on Stack Overflow and add enough code so anyone can reproduce your issue. Please read How to create a Minimal, Complete, and Verifiable example

Community
  • 1
  • 1
Amedee Van Gasse
  • 7,280
  • 5
  • 55
  • 101