Wednesday, March 27, 2013

Working with GhostScript : Convert PDF to images using ghostscript

Ghostscript is an interpreter for PostScript™ and (PDF) files, lets see how we can use it convert PDF to images.

-Install Ghostscript (I am using ubunutu, so I can perform)
sudo apt-get install ghostscript

- run these script via console to make images from pdf

gs -dUseCropBox -dTextAlphaBits=4 -dGraphicsAlphaBits=4 -dAdjustWidth=0 -dNOPROMPT -sDEVICE=jpeg -dSAFER -dBATCH -dNOPAUSE -r140 -dJPEGQ=80  -dFirstPage='1' -dLastPage='8' -sOutputFile=/tmp/output/image-%d.jpg /tmp/downloads/sample.pdf

You can see output like this :

and your output folders will list your images :

FYI - Params :
-dFirstPage and -dLastPage specifies page limits , which is optional
-sOutputFile [output file] [input file]


Wednesday, March 6, 2013

How to add force quit option in ubutnu 12.04

Just got updated my ubuntu version to 12.04 , One of my favorite tool was missing there -Force Quit .
Followed these step and I restored it there in panel

1- create a file named 'Force_Quit.desktop' and contents should be like this

[Desktop Entry]
Name=Force Quit
Comment=Force Kill an Unresponsive Running Application or Window

2- Place it applications folder , you can open application folder directly using these command
    nautilus ~/.local/share/applications/
3- Drag and drop 'Force_Quit.desktop' file in to Unity launcher.

Thats it !