code: public Rectangle getBarcodeSize() {
          float fontX = 0;
          float fontY = 0;
          String fCode = code;
          if (extended)
              fCode = getCode39Ex(code);
          if (font != null) {
              if (baseline > 0)
                  fontY = baseline - font.getFontDescriptor(BaseFont.DESCENT, size);
              else
                  fontY = -baseline + size;
              String fullCode = code;
              if (generateChecksum && checksumText)
                  fullCode += getChecksum(fCode);
              if (startStopText)
                  fullCode = "*" + fullCode + "*";
              fontX = font.getWidthPoint(altText != null ? altText : fullCode, size);
          }
          int len = fCode.length() + 2;
          if (generateChecksum)
              ++len;
          float fullWidth = len * (6 * x + 3 * x * n) + (len - 1) * x;
          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.