def merge_bbox(bbox1, bbox2):
    """Merge two pdf blocks' bounding boxes."""
    return (
        min(bbox1[0], bbox2[0]),  # x0
        min(bbox1[1], bbox2[1]),  # y0
        max(bbox1[2], bbox2[2]),  # x1
        max(bbox1[3], bbox2[3]),  # y1
    )