Split Multiple Page PDF Into a Bunch of One Page Files

I have a bunch of 20-page pdf documents, and each page contains a graphic.

I want to break that 20-page file into 20 files, with one graphic on each page.

Is there an easy way to do this within DevonThink? This problem keeps coming up for me.

Thanks,
Bob

Only if it had a table of contents to it.
You can drag and drop pages out of a PDF individually.

It might be worth looking at this post. Whether it’s worth the effort must depend on how many files you need to process. It’s also possible that you could script preview to print each page back to DT individually.

As a thought experiment, the script below will open a document selected in DT with Preview and print that document back to DT page for page. It requires that you have set up a shortcut ⌘P for the Save PDF to DEVONthink 3 function of the print dialog. The disadvantage of this method is that the original page sizes will be changed to whatever the standard is for the printer which you choose and that each page will have the same name (the latter could be solved, I think).

tell application id "DNtp"
	set theRecords to selected records
	repeat with theRecord in theRecords
		set thePages to page count of theRecord
		set thePath to path of theRecord as string
		tell application "Preview"
			open (thePath as POSIX file)
			repeat with n from 1 to thePages
				activate
				ignoring application responses
					print document in window 1 print dialog 1 with properties {copies:1, starting page:n, ending page:n, target printer:"*name_of_a_printer_on_your_system"}
				end ignoring
				delay 0.5
				tell application "System Events"
					key code 35 using command down
				end tell
				delay 0.5
			end repeat
			close the first window without saving
		end tell
	end repeat
end tell

If you have a lot of them, the best solution might be to subscribe to Adobe Acrobat for a month or two and use its tools.

1 Like

Academic now that Jim has posted a solution with on-board software, but I had looked at Acrobat and it would seem the split action cannot be externally scripted (although I think it can be scripted within the batch processing mechanism using JS).

A command line tool, such as good old pdftk, could be an alternative solution, and for me would be the best bet.

True, but for dealing with files inside a database, this could be a dangerous option to choose. Also, this requires installing a dependency.
The Automator workflow I submitted would be a simple and safe option to use.

This is Exactly what I wanted!

Thanks for your time Bluefrog!

You’re very welcome :slight_smile: