Page 1 of 1

How to convert each PDF page to image file using C#

Posted: 2020-01-30T13:51:14-07:00
by AskAlotLearnAlot
As a beginner to development I don't where to start in converting pdf to images. I know we can use IM but I can't figure out how.
If any of you can direct me to articles or documentations that show steps to start that would be great. I couldn't find any, sorry for the basic question.

Re: How to convert each PDF page to image file using C#

Posted: 2020-01-30T14:57:26-07:00
by fmw42
What is your ImageMagick version and platform/OS? Please provide when asking questions as syntax may vary. Assuming ImageMagick 7,

Code: Select all

magick -density XXX -colorspace sRGB image.pdf image.jpg
Where nominally XXX=72 for default density. Higher density will give larger images and higher quality.

If on ImageMagick 6, then change magick to convert.

Note that to read PDF files, ImageMagick offloads to Ghostscript. So you need to have Ghostscript available to your ImageMagick.


For novices, see

http://www.imagemagick.org/discourse-se ... f=1&t=9620
http://www.imagemagick.org/script/comma ... essing.php
http://www.imagemagick.org/Usage/reference.html
http://www.imagemagick.org/Usage/
https://github.com/ImageMagick/usage-markdown
https://imagemagick.org/script/porting.php#cli

Re: How to convert each PDF page to image file using C#

Posted: 2020-01-31T06:52:05-07:00
by AskAlotLearnAlot
Asp.net MVC5, I downloaded both ImageMagick and Ghostscript from nuget