def revision_index(doc: Doc, rev=-1) -> int:
    """Return bytes index of revision within the file."""
    index = 0
    if rev == -1:
        rev = len(doc.data)-1
    for i in range(rev):
        data = doc.data[i]
        if 'eof_cut' in data:
            index = data['eof_cut']
        else:
            index += len(data['bdata'])
    return index
Return bytes index of revision within the file.
pdfsyntax/docstruct.py