I'd like to make a script on Mac OS 10.3 that converts a pdf to a png. I've been looking around but I'm not sure if its even possible. I keep reading about a "sips" command but it doesn't seem to be available on 10.3, or at least this one. I typed man sips in the terminal and nothing came out. I have written a couple bash scripts and kind of understand how they work but was hoping this specific issue at work would be a good way to practice. I could probably write something that changes the name, but I'm not sure that would work in and of itself as the new png file would probably not actually work. Is there a way from the terminal to basically open preview, open each file and then save as a png? that would probably be the best option. Thanks
When the PDF file is successfully imported, go to the "File" tab and choose "Export To" from the drop-down list. Under the "Export To" drop-down menu, select the "Image" format to access a list of supported image formats. Locate and select the "PNG” option from the list.
Use the following shell script.
test.bash
for i in *.pdf; do
name=$i;
name=${name%.*};
sips -s format png $i --out ${name}.png;
done
bash test.bash
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With