Ejemplo n.º 1
0
def find_box_extrema(boxes):
    """Returns a BoxLine with the extreme values of the boxes."""
    left = min(b.left for b in boxes)
    right = max(b.right for b in boxes)
    bottom = min(b.bottom for b in boxes)
    top = max(b.top for b in boxes)
    page = max(b.page for b in boxes)
    return BoxLine('', left, top, right, bottom, page)
Ejemplo n.º 2
0
def padded_box(box, pad_width, pad_height):
    """Adds some additional margin around the box."""
    return BoxLine(box.letter, box.left - pad_width, box.top + pad_height,
                   box.right + pad_width, box.bottom - pad_height, box.page)