code: public Rectangle getBarcodeSize() {
          float fontX = 0;
          float fontY = 0;
          String text = code;
          if (generateChecksum && checksumText)
              text = calculateChecksum(code);
          if (!startStopText)
              text = text.substring(1, text.length() - 1);
          if (font != null) {
              if (baseline > 0)
                  fontY = baseline - font.getFontDescriptor(BaseFont.DESCENT, size);
              else
                  fontY = -baseline + size;
              fontX = font.getWidthPoint(altText != null ? altText : text, size);
          }
          text = code;
          if (generateChecksum)
              text = calculateChecksum(code);
          byte bars[] = getBarsCodabar(text);
          int wide = 0;
          for (int k = 0; k < bars.length; ++k) {
              wide += bars[k];
          }
          int narrow = bars.length - wide;
          float fullWidth = x * (narrow + wide * n);
          fullWidth = Math.max(fullWidth, fontX);
          float fullHeight = barHeight + fontY;
          return new Rectangle(fullWidth, fullHeight);
      }
docs: Gets the maximum area that the barcode and the text, if
  any, will occupy. The lower left corner is always (0, 0).
  @return the size the barcode occupies.