Spaces:
Running
Running
user commited on
Commit ·
dca8357
1
Parent(s): 6241526
Test
Browse filesFiles changed (2)
- Dockerfile+1-1
- main.py+2-1
8 unmodified lines91011121314158 unmodified lines# 更新 apt 並安裝 Pandoc 和其他必要的套件RUN apt-get update && \apt-get install -y pandoc libreoffice libreoffice-java-common default-jre && \apt-get clean && \rm -rf /var/lib/apt/lists/*8 unmodified lines91011121314158 unmodified lines# 更新 apt 並安裝 Pandoc 和其他必要的套件RUN apt-get update && \apt-get install -y pandoc libreoffice unoconv && \apt-get clean && \rm -rf /var/lib/apt/lists/*
33 unmodified lines3435363738394033 unmodified lines# 使用 LibreOffice 將 PPTX 轉換為 PDFos.environ["HOME"] = "/tmp" # 設定 HOME 環境變量到可寫目錄command_pdf = f"libreoffice --headless --convert-to pdf '{output_pptx_path}' --outdir /tmp"try:subprocess.run(command_pdf, shell=True, check=True)33 unmodified lines343536373839404133 unmodified lines# 使用 LibreOffice 將 PPTX 轉換為 PDFos.environ["HOME"] = "/tmp" # 設定 HOME 環境變量到可寫目錄# command_pdf = f"libreoffice --headless --convert-to pdf '{output_pptx_path}' --outdir /tmp"command_pdf = f"unoconv -f pdf -o '/tmp' '{output_pptx_path}'"try:subprocess.run(command_pdf, shell=True, check=True)
Dockerfile+1-1
main.py+2-1