Skip to content

Commit

Permalink
Merge pull request #54 from CybercentreCanada/rtf
Browse files Browse the repository at this point in the history
Add support for RTF documents
  • Loading branch information
cccs-rs authored Apr 13, 2023
2 parents 209e70f + d7f404f commit 95822ef
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions document_preview/document_preview.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ def pdf_to_images(self, file, max_pages=None):
i += 1

def render_documents(self, request: Request, max_pages=1):
# Word/Excel/Powerpoint
if any(request.file_type == f'document/office/{ms_product}' for ms_product in ['word', 'excel', 'powerpoint']):
# Word/Excel/Powerpoint/RTF
if any(request.file_type == f'document/office/{ms_product}' for ms_product in ['word', 'excel', 'powerpoint', 'rtf']):
orientation = "landscape" if any(request.file_type.endswith(type)
for type in ['excel', 'powerpoint']) else "portrait"
converted = self.office_conversion(request.file_path, orientation, max_pages)
Expand Down

0 comments on commit 95822ef

Please sign in to comment.