def remove_page_boundary_lines(docbody):
    """Try to locate page breaks, headers and footers within a document body,
       and remove the array cells at which they are found.
       @param docbody: (list) of strings, each string being a line in the
        document's body.
       @return: (list) of strings. The document body, hopefully with page-
        breaks, headers and footers removed. Each string in the list once more
        represents a line in the document.
    """
    number_head_lines = number_foot_lines = 0
    # Make sure document not just full of whitespace:
    if not document_contains_text(docbody):
        # document contains only whitespace - cannot safely
        # strip headers/footers
        return docbody

    # Get list of index posns of pagebreaks in document:
    page_break_posns = get_page_break_positions(docbody)

    # Get num lines making up each header if poss:
    number_head_lines = get_number_header_lines(docbody, page_break_posns)

    # Get num lines making up each footer if poss:
    number_foot_lines = get_number_footer_lines(docbody, page_break_posns)

    # Remove pagebreaks,headers,footers:
    docbody = strip_headers_footers_pagebreaks(docbody,
                                               page_break_posns,
                                               number_head_lines,
                                               number_foot_lines)

    return docbody
def remove_page_boundary_lines ( docbody ) : number_head_lines = number_foot_lines = 0 if not document_contains_text ( docbody ) : return docbody page_break_posns = get_page_break_positions ( docbody ) number_head_lines = get_number_header_lines ( docbody , page_break_posns ) number_foot_lines = get_number_footer_lines ( docbody , page_break_posns ) docbody = strip_headers_footers_pagebreaks ( docbody , page_break_posns , number_head_lines , number_foot_lines ) return docbody
Try to locate page breaks, headers and footers within a document body,
       and remove the array cells at which they are found.
       @param docbody: (list) of strings, each string being a line in the
        document's body.
       @return: (list) of strings. The document body, hopefully with page-
        breaks, headers and footers removed. Each string in the list once more
        represents a line in the document.