Fixes: libreoffice export pdf issue
This commit is contained in:
parent
098267940b
commit
efea0bc081
2 changed files with 7 additions and 3 deletions
|
|
@ -44,7 +44,7 @@ class ExportAsPptxHandler(FetchPresentationAssetsMixin):
|
|||
|
||||
ppt_path = os.path.join(
|
||||
self.presentation_dir,
|
||||
f"{presentation.title.replace('/', '_').replace(' ', '_')}.pptx",
|
||||
f"{presentation.title.replace('/', '_').replace(' ', '_').replace('"', "'")}.pptx",
|
||||
)
|
||||
ppt_creator = PptxPresentationCreator(self.data.pptx_model, self.temp_dir)
|
||||
ppt_creator.create_ppt()
|
||||
|
|
|
|||
|
|
@ -10,12 +10,16 @@ def get_pdf_from_pptx(pptx_path: str, temp_dir: str) -> str:
|
|||
base_name = os.path.splitext(os.path.basename(pptx_path))[0]
|
||||
print(base_name)
|
||||
|
||||
subprocess.run(
|
||||
f"{os.getenv('LIBREOFFICE')} --headless --invisible --convert-to pdf {pptx_path} --outdir {temp_dir}",
|
||||
result = subprocess.run(
|
||||
f'{os.getenv("LIBREOFFICE")} --convert-to pdf "{pptx_path}" --outdir "{temp_dir}"',
|
||||
shell=True,
|
||||
capture_output=True,
|
||||
text=True,
|
||||
)
|
||||
|
||||
print("LibreOffice stdout:", result.stdout)
|
||||
print("LibreOffice stderr:", result.stderr)
|
||||
|
||||
pdf_filename = f"{base_name}.pdf"
|
||||
pdf_path = os.path.join(temp_dir, pdf_filename)
|
||||
print(pdf_path)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue