Take the 2-minute tour ×
Software Recommendations Stack Exchange is a question and answer site for people seeking specific software recommendations. It's 100% free, no registration required.

I need a program/sdk/software to convert pdf file to images.I require the following features in that converter:

Check if the pdf file is colored or BW. If the pdf file is BW, an option to convert the pdf file to .tiff images. If the pdf file is Colored, an option to convert the pdf file to .png images. This conversion should be fast and if possible, should have multi-threading option. It can be a free tool (open source) or a paid solution that I can integrate with Visual Studio 2010 C#. Meaning a command line interface would work.

share|improve this question

1 Answer 1

up vote 5 down vote accepted

To check whether the PDF is colored or BW, you can use Ghostscript (free, open-source, cross-platform):

Example commandline:

gs -o - -sDEVICE=inkcov /path/to/your.pdf

Example output:

Page 1
0.00000  0.00000  0.00000  0.02230 CMYK OK
Page 2
0.02360  0.02360  0.02360  0.02360 CMYK OK
Page 3
0.02525  0.02525  0.02525  0.00000 CMYK OK
Page 4
0.00000  0.00000  0.00000  0.01982 CMYK OK

You can see here that the page 4 is using no color, while pages 1+2+3 do. This case is particularly 'nasty' for people who want to save on color ink: because all the C, M, Y (and K) values are exactly the same for each of the pages 1-3, they possibly could appear to the human eye not as color pages, but as ("rich") grayscale anyway (if each single pixel is mixed with these color values).

Other ideas: How do I know if PDF pages are color or black-and-white?


To convert a PDF to TIFF, you can use GhostScript (free, open-source, cross-platform):

on Windows:

gswin32c -dNOPAUSE -q -g300x300 -sDEVICE=tiffg4 -dBATCH -sOutputFile=output_file_name.tif input_file_name.pdf

on *nix:

gs -dNOPAUSE -q -g300x300 -sDEVICE=tiffg4 -dBATCH -sOutputFile=output_file_name.tif input_file_name.pdf

Other ideas: Best way to convert pdf files to tiff files


To convert a PDF to PNG, you can use ImageMagick (free, open-source, cross-platform):

convert foo.pdf pages-%03d.png
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.