def build_xref_table(table: list, index: list) -> str:
    """Display XREF table with additional links to objects."""
    ret = ''
    for x in table:
        if len(x) == 2:
            start, size = x
            ret += f'{start}  {size}'
        else:
            _, _, _, y = x
            _, pos, o_num, o_gen, st = y
            ret += f'{pos:010} {o_gen:05} {st.decode("ascii")}'
            if st != b'f':
                ret += '    '
                ret += f'<a href="#idx{pos}">'
                ret += f'<span class="obj-link">#{o_num} {o_gen}</span>'
                ret += '</a>'
        ret += '\n'
    return ret
Display XREF table with additional links to objects.
pdfsyntax/display.py