R
Railwayβ€’7mo ago
botdev

.pptx to .pdf converter

I have python-pptx library. My python code can generate PowerPoint presentations using python-pptx library. How can I convert those pptx file into .pdf on railwayapp servers?
16 Replies
Percy
Percyβ€’7mo ago
Project ID: N/A
Fragly
Fraglyβ€’7mo ago
Could proably use ffmpeg-python πŸ€” not sure if ffmpeg supports those file formats though, haven't tried
botdev
botdevβ€’7mo ago
Thanks for the reply. It look like this library does not support .pptx files and convertions.
Fragly
Fraglyβ€’7mo ago
Dang, that sucks, maybe someone else has an idea for what to use then
Brody
Brodyβ€’7mo ago
sorry this isnt really a railway related question
botdev
botdevβ€’7mo ago
Would it be possible to install LibreOffice and run command line commands in python to convert .pptx file into .pdf? like this: import subprocess def convert_pptx_to_pdf(pptx_file, output_dir): command = [ "libreoffice", "--headless", "--convert-to", "pdf", pptx_file, "--outdir", output_dir ] subprocess.run(command)
Brody
Brodyβ€’7mo ago
one way or another, yeah do you currently have a nixpacks.toml file?
botdev
botdevβ€’7mo ago
I dont know what is that file. Where can I find it?
Brody
Brodyβ€’7mo ago
well if you dont know what it is, it means you dont have one lol add a nixpacks.toml file to your project with this in it
[phases.setup]
nixPkgs = ['...', 'libreoffice']
[phases.setup]
nixPkgs = ['...', 'libreoffice']
botdev
botdevβ€’7mo ago
Thanks! Will try this.
Brody
Brodyβ€’7mo ago
fragly id like to inquire about what ffmpeg has to do with power point or pdf files 🀣
Fragly
Fraglyβ€’7mo ago
I watched a firebase video and all I remember about is that ffmpeg does something with files so i figured it might help πŸ’€
Brody
Brodyβ€’7mo ago
ffmpeg is a media encoding tool like MP4 and stuff like that
Fragly
Fraglyβ€’7mo ago
ohh thanks for clarifying! πŸ™
Brody
Brodyβ€’7mo ago
this better not hurt your confidence in helping though!
Fragly
Fraglyβ€’7mo ago
Don't worry, It won't <:chad_gamer:1000044370411663370>