Saving all the pages of a PDF as JPG

Hello
Iam a newbie to applescript… Please anyone suggest me how to create the jpg of each pages in a PDF…

thank you in advance

How about this ready-to-use code?
:smiley:

thank you for the reply…
Is there anyway to create this by opening the Acrobat Professional using script and save each page as JPEG.
Can you suggest me regarding this.
Thank you.

Sorry, I do not have Acrobat Pro installed, so I cannot help you with code examples. Maybe someone can assist you.

ok thank you so much…

This function in Acrobat Pro is not directly scriptable. A portion of GUI scripting is needed to pass the dialog box.
I recommend to use Martin’s solution. It’s much smarter and doesn’t require any application.
The quality of the images is the same.

Ya thank you stefen …Using Acrobat Professional we can directly save as JPEG of all the pages of PDF. Cant we do this by script?.

Regards
urskaush

Yes, but as mentioned above, it requires GUI scripting which is time critical and not very reliable.
I would never recommend to use any GUI scripting solution if there is a work around.
What’s the problem with Martin’s script?

ok thank you so much stefen…
I will try that… I just wanted to know since i have seen in the blogs wher people use that GUI scripting , thought its bit simpler than that code.

The best code is the code you don’t have to write :wink:

Stefan, in Acrobat Pro it is directly scriptable with AppleScript using the conversion parameter of save:

save front document to file New_File_Path using conversion "com.adobe.acrobat.jpeg"

Multi page docs are automatically handled for you.

Thanks Mark, I overlooked that in the dictionary

For the list of other options (that I can’t remember if there listed or not) just:

tell application "Adobe Acrobat 7.0 Professional"
	get conversions
end tell

Thanks, Mark67. I use your approach to convert PDFs to tif successfully. However, how can I control the parameters such as Profile Embedding, Resolution, etc?

Thanks again!

In Acrobat’s Prefs are a whole bunch related to ‘Convert from PDF’ you would need to set these in the GUI first no access from script via the Acrobat dictionary. You may be able to change via writing to the prefs file but I have not tried this.

Thank you for your prompt respond, Mark67! :slight_smile:

I will try using GUI to set those parameters. But I always counter error message when executing a GUI script:-

System Events got an error:
NSReceiverEvaluationScriptError: 4

I did not mean by scripting the GUI with system events (which is always a last resort) I meant setting from within the application itself first before running your script. BTW if you ‘always’ receive this error have you checked to see if your system prefs are correct and you have ‘enable access for assistive devices’ checked on under ‘universal access’

Thanks for your advice, Mark67.

I have checked the “enable access for assistive devices” but the problem still persists. May I know, beside this setting, what else should I take note? Tks!