Applied a patch by Axel Kaiser.

pull/1/head
Yusuke Shinyama 2014-03-24 20:43:36 +09:00
parent d7c4ff28e9
commit 607be269ab
2 changed files with 2 additions and 2 deletions

View File

@ -219,7 +219,7 @@ class PDFXRefStream(PDFBaseXRef):
if not isinstance(stream, PDFStream) or stream['Type'] is not LITERAL_XREF:
raise PDFNoValidXRef('Invalid PDF stream spec.')
size = stream['Size']
index_array = stream.get('Index', (1, size))
index_array = stream.get('Index', (0, size))
if len(index_array) % 2 != 0:
raise PDFSyntaxError('Invalid index number')
self.ranges.extend(choplist(2, index_array))

View File

@ -313,7 +313,7 @@ class PDFPageInterpreter(object):
return
def dup(self):
return PDFPageInterpreter(self.rsrcmgr, self.device)
return self.__class__(self.rsrcmgr, self.device)
# init_resources(resources):
# Prepare the fonts and XObjects listed in the Resource attribute.