I would like to convert a PDF file to .GIF using C# and magicknet.dll. I have added the reference to the MagickNet Dll to my project.
MagickNet.Magick.Init();
Ma
ImageMagick requires GhostScript to Interpret PDF files. If you want you can call the GhostScript dll directly (contact me via my profile, I will send you a c# wrapper)
Alternatively you can use the GhostScript command line or a commercial 3rd party component, eg the PDF libraries from Tall Components.
Magic.Net is a C# port for popular library ImageMagick. Install Magick.net using Nuget package from url https://www.nuget.org/packages/Magick.NET-Q16-AnyCPU/ . This way you can use C#. See code below
Note it will append images vertically. Similarly you can append horizontally i.e. substitute images.AppendHorizontally
using ImageMagick;
string inputPdf= @"C:\my docs\input.pdf";
string outputPng= @"C:\my docs\output.png";
using (MagickImageCollection images = new MagickImageCollection())
{
images.Read(inputPdf);
using (IMagickImage vertical = images.AppendVertically())
{
vertical.Format = MagickFormat.Png;
vertical.Density = new Density(300);
vertical.Write(outputPng);
}
}