R
Railwayβ€’12mo 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β€’12mo ago
Project ID: N/A
Fragly
Fraglyβ€’12mo ago
Could proably use ffmpeg-python πŸ€” not sure if ffmpeg supports those file formats though, haven't tried
botdev
botdevOPβ€’12mo ago
Thanks for the reply. It look like this library does not support .pptx files and convertions.
Fragly
Fraglyβ€’12mo ago
Dang, that sucks, maybe someone else has an idea for what to use then
Brody
Brodyβ€’12mo ago
sorry this isnt really a railway related question
botdev
botdevOPβ€’12mo 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β€’12mo ago
one way or another, yeah do you currently have a nixpacks.toml file?
botdev
botdevOPβ€’12mo ago
I dont know what is that file. Where can I find it?
Brody
Brodyβ€’12mo 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
botdevOPβ€’12mo ago
Thanks! Will try this.
Brody
Brodyβ€’12mo ago
fragly id like to inquire about what ffmpeg has to do with power point or pdf files 🀣
Fragly
Fraglyβ€’12mo 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β€’12mo ago
ffmpeg is a media encoding tool like MP4 and stuff like that
Fragly
Fraglyβ€’12mo ago
ohh thanks for clarifying! πŸ™
Brody
Brodyβ€’12mo ago
this better not hurt your confidence in helping though!
Fragly
Fraglyβ€’12mo ago
Don't worry, It won't <:chad_gamer:1000044370411663370>
Want results from more Discord servers?
Add your server