code: def find_xref(self, parser):
          
          # search the last xref table by scanning the file backwards.
          prev = None
          for line in parser.revreadlines():
              line = line.strip()
              if self.debug:
                  logging.debug('find_xref: %r' % line)
              if line == b'startxref':
                  break
              if line:
                  prev = line
          else:
              raise PDFNoValidXRef('Unexpected EOF')
          if self.debug:
              logging.info('xref found: pos=%r' % prev)
          return long(prev)
docs: Internal function used to locate the first XRef.