I want to convert the cover page of a PDF into an image. so far, i have heard about 2 image processing tools in Linux. They are
- ImageMagick
- Ghostscript
For PDF conversion, ImageMagick runs Ghostscript behind the scene. To install Ghostscript in Mac, you can download the dmg @ UPFLYSOFT.
After the installation, you can run the gs command in shell. Here is the command to convert a PDF cover into PNG.
- gs -q -sDEVICE=pngalpha -dBATCH -dNOPAUSE -dFirstPage=1 -dLastPage=1 -r300 -sOutputFile=cover.png sample.pdf
You can even convert the image to mono color by simple modify the sDEVICE parameter to pngmono. If you want to convert other pages, just modify the dFirstPage and dLastPage parameters. And if you want to know the available sDEVICE, enter the following command.
- gs -h
Thanks Scott @ Moving to Freedom
Done =)
Reference:
For batch conversion from or to pdf these are the mightiest tools you can find. If you want to have a graphical user interface instead you can give the gimp a try: A mighty graphics program that for reading PDF files will internally use ghostscript, too.
LikeLike
Ya~ will take a look on gimp if i have the chance to use it later.
thanks for your comment. =D
LikeLike