pptx_to_pdf script

This commit is contained in:
Luca Lombardo
2024-01-22 16:02:15 +01:00
parent cf473ff4a4
commit 2731ce32d3
2 changed files with 34 additions and 4 deletions
+20
View File
@@ -0,0 +1,20 @@
#!/bin/bash
# Create the pdf folder if it doesn't exist
mkdir -p pdf
# Iterate through all .pptx files in the current folder
for file in *.pptx; do
if [ -f "$file" ]; then
# Extract the base name (without extension) of the file
base_name=$(basename "$file" .pptx)
# Convert the .pptx file to .pdf and save it in the pdf folder
libreoffice --headless --convert-to pdf --outdir pdf "$file"
echo "Converted $file to pdf/$base_name.pdf"
fi
done
echo "Conversion complete!"