You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
21 lines
523 B
Plaintext
21 lines
523 B
Plaintext
10 months ago
|
#!/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!"
|
||
|
|