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

Method read_xref

pattern/web/pdf/pdfparser.py:741–755  ·  view source on GitHub ↗

Reads all the XRefs in the PDF file and returns them.

(self)

Source from the content-addressed store, hash-verified

739
740 # read xref tables and trailers
741 def read_xref(self):
742 """Reads all the XRefs in the PDF file and returns them."""
743 xrefs = []
744 try:
745 pos = self.find_xref()
746 self.read_xref_from(pos, xrefs)
747 except PDFNoValidXRef:
748 # fallback
749 if 1 <= self.debug:
750 print >>sys.stderr, 'no xref, fallback'
751 self.fallback = True
752 xref = PDFXRef()
753 xref.load_fallback(self)
754 xrefs.append(xref)
755 return xrefs
756
757
758## PDFStreamParser

Callers 1

set_parserMethod · 0.80

Calls 5

find_xrefMethod · 0.95
read_xref_fromMethod · 0.95
load_fallbackMethod · 0.95
PDFXRefClass · 0.85
appendMethod · 0.45

Tested by

no test coverage detected