def get_page_fonts(doc: Doc, page_nums: list) -> list:
    """Return a list of fonts dict of each page.

    Dict key is font name, for example /F1
    """
    ret = []
    for page_num in page_nums:
        fonts = {}
        font_res = {}
        page_ref, _ = flat_page_tree(doc)[page_num]
        resources = get_object(doc, page_ref)['/Resources']
        if resources:
            fonts = get_object(doc, resources)['/Font']
        for font in fonts:
            font_res[font] = prepare_font(doc, fonts[font])
        ret.append(font_res)
    return ret
Return a list of fonts dict of each page.

    Dict key is font name, for example /F1
    
pdfsyntax/docstruct.py