def get_pos_in_stream(envelope):
    """Calculate current object position in the stream."""
    entries = envelope['entries']
    pos = (len(entries['/FirstLine']) // 2) - 1
    return pos
Calculate current object position in the stream.
pdfsyntax/filestruct.py