Exemplo n.º 1
0
  /** Returns true, if the given shape should be considered on extraction. */
  public static boolean considerPdfShape(PdfShape shape, Rectangle clippingPath) {
    if (shape == null) {
      return false;
    }

    PdfColor color = shape.getColor();

    if (color == null) {
      return false;
    }

    if (color.isWhite()) {
      return false;
    }

    // If the clipping path is given, it must contain the shape.
    if (clippingPath != null) {
      return clippingPath.overlaps(shape.getRectangle());
    }

    return true;
  }