Revert the wrong fix.
parent
b18e8c549d
commit
57adad55d7
|
@ -218,7 +218,7 @@ class PDFXRefStream(PDFBaseXRef):
|
||||||
if not isinstance(stream, PDFStream) or stream['Type'] is not LITERAL_XREF:
|
if not isinstance(stream, PDFStream) or stream['Type'] is not LITERAL_XREF:
|
||||||
raise PDFNoValidXRef('Invalid PDF stream spec.')
|
raise PDFNoValidXRef('Invalid PDF stream spec.')
|
||||||
size = stream['Size']
|
size = stream['Size']
|
||||||
index_array = stream.get('Index', (1, size))
|
index_array = stream.get('Index', (0, size))
|
||||||
if len(index_array) % 2 != 0:
|
if len(index_array) % 2 != 0:
|
||||||
raise PDFSyntaxError('Invalid index number')
|
raise PDFSyntaxError('Invalid index number')
|
||||||
self.ranges.extend(choplist(2, index_array))
|
self.ranges.extend(choplist(2, index_array))
|
||||||
|
@ -246,6 +246,7 @@ class PDFXRefStream(PDFBaseXRef):
|
||||||
for (start, nobjs) in self.ranges:
|
for (start, nobjs) in self.ranges:
|
||||||
if start <= objid and objid < start+nobjs:
|
if start <= objid and objid < start+nobjs:
|
||||||
index += objid - start
|
index += objid - start
|
||||||
|
break
|
||||||
else:
|
else:
|
||||||
index += nobjs
|
index += nobjs
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Reference in New Issue