I want to convert a pdf with several pages to single image files using sips. I know there are several other (probably better) solutions to do this but sips is installed on every mac and don't need a licence.
What I tried:
sips -s format png myPDF.pdf --out myIMG.png
That gives me an image of the first site from the pdf.
Now my Question: Is there a possibility to get images for each page of the pdf?
Thanks for your advise!
I have no idea whether you are supposed to do this sort of thing this way, but the Automator on macOS has an action called
Split PDF
which you could use to split a PDF into separate pages and then usesips
on each one...To start Automator, press ⌘space and start typing
Automator
till it guesses correctly and hit ↩. This is called a Spotlight Search apparently and is the quickest way to find anything on a Mac but no-one tells you that!Then create a new Application, and select
PDFs
on the left (highlighted in red), thenSplit PDF
(also in red) and drag that into the "work-area" on the right.I saved that then as
splitter
.Then I started Terminal - same Spotlight Search method as starting Automator above, but start typing
Terminal
instead.Now go to where you saved
splitter
and you'll seesplitter.app
:Now I want to split a 10-page document called
"a.pdf"
, so I ran:Sample Output
And it spits out 10 separate 1-page PDF documents on my desktop named per the output.
I have no idea what the warning about "Photos App" cache file means, so if anyone knows, maybe they would tell me what it means and how to get rid of it.
Also, I presume that Automator is somehow calling the action from
/System/Library/Automator/Split PDF.action
:But, I have no idea how I can execute/call that from Terminal, without needing to start/write any Automator stuff. So, if anyone, @vadian maybe, knows, I would love to know that too! It appears to be a bundle, but if I run
mdls
on it, there is no bundle identifier listed, so I cannot run it with: