Search for a string on a page.

    Args:
        text: string to be searched for
        hit_max: maximum hits
        quads: return quads instead of rectangles
    Returns:
        a list of rectangles or quads, each containing one occurrence.

def searchFor(page, text, hit_max = 16, quads = False):
    """ Search for a string on a page.

    Args:
        text: string to be searched for
        hit_max: maximum hits
        quads: return quads instead of rectangles
    Returns:
        a list of rectangles or quads, each containing one occurrence.
    """
    CheckParent(page)
    dl = page.getDisplayList()         # create DisplayList
    tp = dl.getTextPage()              # create TextPage
    # return list of hitting reactangles
    rlist = tp.search(text, hit_max = hit_max, quads = quads)
    dl = None
    tp = None
    return rlist