def build_xref_stream(table: list, index: list) -> str:
    """Display XREF table with additional links to objects."""
    ret = ''
    ret += '\nstream\n\n'
    for x in table:
        _, _, _, y = x
        _, pos, o_num, o_gen, st, env_num, raw_line = y
        if o_num != 0:
            if env_num:
                #abs_pos = envs[env_num] + (pos + 1) / 10000
                #ret += f'<a href="#idx{abs_pos}">'
                ret += f'<a href="#obj{o_num}.{o_gen}.0">'
            else:
                ret += f'<a href="#idx{pos}">'
            ret += f'<span class="obj-link">#{o_num} {o_gen}</span>'
            ret += '</a>'
            ret += '    '
            if env_num:
                ret += f'In object stream {env_num} at {pos:010} {st.decode("ascii")}\n'
            else:
                ret += f'At absolute position {pos:010} {st.decode("ascii")}\n'
    ret += '\nendstream\n'
    return ret
Display XREF table with additional links to objects.
pdfsyntax/display.py