Using Adobe Acrobat 9 in command line to covert from pdf to png using export function
I am trying to use the command line to convert a pdf to png using the export function of adobe acrobat 9. Anyone know how to do this?
A program I am writing in Java will need to run this command.
Than开发者_运维技巧ks for the help.
Other than this paltry detail, there's no documentation on Acrobat's command line... if there's anything more to document.
I suggest you go with Ghostscript instead. They actually document their command line and are Free.
The commandline would be something like:
gs -o -q -sOutputFile=MyOutPath.png -sDevice=png16m -r300 inputPdf.pdf
- -o puts it in batch mode (mostly)
- -q quite mode (no std out)
- -sOutputFile self explanatory
- -sDevice=png16m 24-bit rgb. alternatives include pngalpha, png8, pngmono, png256.
- -r300 300 dpi.
I also use:
- -dTextAlphaBits=4 antialiasing info for improved text quality
- -dGraphicsAlphaBits=4 ditto, only for line art.
These two vastly improved the quality of my output (I use jpeg, not png) at the DPI I use. If no one's going to zoom in on them, 72 or 96 is fine... but folks will zoom in on my images, so I ramped up the dots per inch a bit.
In java, you must use command line function to open adobe acrobat then use the Robot function of Java in the awt package to emulate keystrokes to go to the export function and convert to PNG.
精彩评论