Fix #245
parent
5330620ea2
commit
6c4b468800
|
|
@ -33,13 +33,14 @@ class PDFHandler(object):
|
|||
self.filepath = filepath
|
||||
if not filepath.lower().endswith('.pdf'):
|
||||
raise NotImplementedError("File format not supported")
|
||||
self.pages = self._get_pages(self.filepath, pages)
|
||||
|
||||
if password is None:
|
||||
self.password = ''
|
||||
else:
|
||||
self.password = password
|
||||
if sys.version_info[0] < 3:
|
||||
self.password = self.password.encode('ascii')
|
||||
self.pages = self._get_pages(self.filepath, pages)
|
||||
|
||||
def _get_pages(self, filepath, pages):
|
||||
"""Converts pages string to list of ints.
|
||||
|
|
|
|||
Loading…
Reference in New Issue