Skip to content

Commit

Permalink
Merge pull request #55 from CybercentreCanada/rtf
Browse files Browse the repository at this point in the history
Rtf
  • Loading branch information
cccs-rs authored Apr 13, 2023
2 parents 88f8c99 + d7f404f commit 3361930
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ RUN apt-get update && apt-get install -y wget

# Install Libreoffice
RUN pip install unoconv
RUN wget https://tdf.mirror.rafal.ca/libreoffice/stable/7.5.1/deb/x86_64/LibreOffice_7.5.1_Linux_x86-64_deb.tar.gz
RUN wget https://tdf.mirror.rafal.ca/libreoffice/stable/${LIBRE_BUILD_VERSION}/deb/x86_64/LibreOffice_${LIBRE_BUILD_VERSION}_Linux_x86-64_deb.tar.gz
RUN tar zxvf LibreOffice_${LIBRE_BUILD_VERSION}_Linux_x86-64_deb.tar.gz && rm -f LibreOffice_${LIBRE_BUILD_VERSION}_Linux_x86-64_deb.tar.gz
RUN dpkg -i LibreOffice_${LIBRE_BUILD_VERSION}*/DEBS/*.deb && rm -rf LibreOffice_${LIBRE_BUILD_VERSION}*
RUN apt-get install -y libdbus-1-3 libcups2 libsm6 libice6
Expand Down
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 3361930

Please sign in to comment.