We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 4ce4f3f commit a3e4272Copy full SHA for a3e4272
convert.sh
@@ -0,0 +1,21 @@
1
+#!/bin/bash
2
+
3
+# Retrieve input and output paths from arguments
4
+inputPath="$1"
5
+outputPath="$2"
6
7
+# Check if the input file exists
8
+if [ ! -f "$inputPath" ]; then
9
+ echo "Input file does not exist: $inputPath"
10
+ exit 1
11
+fi
12
13
+# Convert the Word file to PDF using textutil command
14
+textutil -convert pdf "$inputPath" -output "$outputPath"
15
16
+# Check if the conversion was successful
17
+if [ $? -eq 0 ]; then
18
+ echo "Conversion completed: $inputPath to $outputPath"
19
+else
20
+ echo "Conversion failed."
21
0 commit comments