Add workaround for PDF with IndirectObject as the
rotation value. GitHub #261. Signed-off-by: Roberto Rosario <roberto.rosario.gonzalez@gmail.com>
This commit is contained in:
@@ -1,3 +1,8 @@
|
|||||||
|
2.6.5 (2017-XX-XX)
|
||||||
|
==================
|
||||||
|
- Add workaround for PDF with IndirectObject as the
|
||||||
|
rotation value. GitHub #261.
|
||||||
|
|
||||||
2.6.4 (2017-07-26)
|
2.6.4 (2017-07-26)
|
||||||
==================
|
==================
|
||||||
- Add missing replacements of reverse to resolve_url.
|
- Add missing replacements of reverse to resolve_url.
|
||||||
|
|||||||
@@ -92,7 +92,9 @@ class Python(ConverterBase):
|
|||||||
if self.mime_type == 'application/pdf':
|
if self.mime_type == 'application/pdf':
|
||||||
pdf = PyPDF2.PdfFileReader(self.file_object)
|
pdf = PyPDF2.PdfFileReader(self.file_object)
|
||||||
try:
|
try:
|
||||||
result = pdf.getPage(page_number - 1).get('/Rotate')
|
result = pdf.getPage(page_number - 1).get('/Rotate', 0)
|
||||||
|
if isinstance(result, PyPDF2.generic.IndirectObject):
|
||||||
|
result = result.getObject()
|
||||||
except Exception as exception:
|
except Exception as exception:
|
||||||
self.file_object.seek(0)
|
self.file_object.seek(0)
|
||||||
pdf = PyPDF2.PdfFileReader(self.file_object)
|
pdf = PyPDF2.PdfFileReader(self.file_object)
|
||||||
|
|||||||
Reference in New Issue
Block a user