MCPcopy Index your code
hub / github.com/clips/pattern / find_xref

Method find_xref

pattern/web/pdf/pdfparser.py:688–703  ·  view source on GitHub ↗

Internal function used to locate the first XRef.

(self)

Source from the content-addressed store, hash-verified

686 return
687
688 def find_xref(self):
689 """Internal function used to locate the first XRef."""
690 # search the last xref table by scanning the file backwards.
691 prev = None
692 for line in self.revreadlines():
693 line = line.strip()
694 if 2 <= self.debug:
695 print >>sys.stderr, 'find_xref: %r' % line
696 if line == 'startxref': break
697 if line:
698 prev = line
699 else:
700 raise PDFNoValidXRef('Unexpected EOF')
701 if 1 <= self.debug:
702 print >>sys.stderr, 'xref found: pos=%r' % prev
703 return long(prev)
704
705 # read xref table
706 def read_xref_from(self, start, xrefs):

Callers 1

read_xrefMethod · 0.95

Calls 3

PDFNoValidXRefClass · 0.85
revreadlinesMethod · 0.80
stripMethod · 0.80

Tested by

no test coverage detected