Skip to main content

Posts

Showing posts from February, 2008

Convert your PDF to Images

PDF is one of the most widely used format for distribution of electronic documents. My article on ASP Alliance Creating PDFs with C# using Ghostscript gives a brief idea on conversion of different document formats into PDF. Ghostscript supports output to a variety of image file formats from pdf and ps files. These formats are called "output devices" in Ghostscript terminology. The ghostscript executible gswin32c.exe can be used to achieve this. The command used for this is as follows: gswin32c -dSAFER -dBATCH -dNOPAUSE -sDEVICE=jpeg -o out_%d.jpg inputFile.pdf -sDEVICE is used to specify the output device or the driver -dSAFER -dBATCH -dNOPAUSE options suppress interactive prompts and enable some security checks on the file to be run. -o is used to specify the output file name. %d option helps to automatically assign file names as per the page number. So, if a file has 10 pages, 10 files will be created. The supported devices are as follows: PNG png16m : 24-bit RGB color png