shell script to change .pdf files to .png Mac OS 10.3

后端 未结 1 1680
独厮守ぢ
独厮守ぢ 2021-02-15 17:05

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

1条回答
  •  野性不改
    2021-02-15 18:00

    I don't have a suitable system to test on, but I think sips appeared in 10.3. (It's definitely in 10.4.)

    Just because there is no man page doesn't mean that it isn't there (try sips -h or ls /usr/bin/sips).

    If it's there, Sorpigal's answer (+1) is good for the basic scripting, but replace

    convert "$pdf" "${pdf%%.*}.png"
    

    with

    sips -s format png --out "${pdf%%.*}.png" "$pdf"
    

    0 讨论(0)
提交回复
热议问题