Internal function used to locate the first XRef.
(self)
| 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): |
no test coverage detected