pull/2/head
yatintaluja 2019-01-16 16:33:17 +05:30
parent 5330620ea2
commit 6c4b468800
1 changed files with 2 additions and 1 deletions

View File

@ -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.