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

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
AskAlotLearnAlot
Posts: 2
Joined: 2020-01-30T13:44:31-07:00
Authentication code: 1152

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

Post 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.

User avatar
fmw42
Posts: 26273
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

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

Post 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

AskAlotLearnAlot
Posts: 2
Joined: 2020-01-30T13:44:31-07:00
Authentication code: 1152

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

Post by AskAlotLearnAlot »

Asp.net MVC5, I downloaded both ImageMagick and Ghostscript from nuget

Post Reply