Q: How to fix itext basefont error: Exception in thread "main" java.lang.NoSuchMethodError: com.lowagie.text.pdf.BaseFont.getCharBBox(I)[I Any way to solve the base font error with itext.
I have searched the internet to resolve this error:
Exception in thread "main" java.lang.NoSuchMethodError: com.lowagie.text.pdf.BaseFont.getCharBBox(I)[I
it seems like a platform error. I am using eclipse in window os and in every sort of renderer i use that requires itext i keep getting that error.
I know am not the only one that has come across this error.
I got same error using flying saucer to create pdf out of xhtml.
I also go same error trying to use docx4j for xhtml to docx convertion.
I want to know if there is a way around this base font error

A: After hours of frustrations i finally solved my problem.
I found the solution to the version signature in this link:
https://groups.google.com/forum/#!msg/flying-saucer-users/5yXdrIpNnSs/YwY-oETKXD8J
You just have to use the itext version that contain the getCharBBox(I)[I method.
You can also use itext5 XML Worker or itext7 pdfHTML to do your html to pdf conversions.
As Bruno Lowagie suggested, but for my case i was using docx4j to convert xhtml to docx and i really need the version of itext the renderer require.
Itext-2.1.x and flying saucer 9.0.2 solved my problem. Both are compactible as the trend https://groups.google.com/forum/#!msg/flying-saucer-users/5yXdrIpNnSs/YwY-oETKXD8J specified:
I did double-check that the released version of 9.0.2 uses the proper signature for iText 2.1.x (see below).
Pete
private void setMetricDefaults();
  Signature: ()V
  Code:
   0:   aload_0
   1:   ldc #12; //float -50.0f
   3:   putfield    #8; //Field _underlinePosition:F
   6:   aload_0
   7:   ldc #13; //float 50.0f
   9:   putfield    #9; //Field _underlineThickness:F
   12:  aload_0
   13:  getfield    #4; //Field _font:Lcom/lowagie/text/pdf/BaseFont;
   16:  bipush  120
   18:  invokevirtual   #14; //Method com/lowagie/text/pdf/BaseFont.getCharBBox:(I)[I
Hope this helps someone else that encounters same problem.
