This project has moved and is read-only. For the latest updates, please go here.

Create Formatted PDF from an Image Collection

Oct 25, 2013 at 8:29 PM
Hi,

I have a collection of images that I need to create a PDF contact sheet for. I would like to format the PDF contact sheet, so that it contains a 2 x 6 grid per page, with a File Name caption beneath each image. Is there a way I can accomplish this via Magick.NET only? (I know there are other .NET plugins for PDF creation, but I'd rather just stick with Magick.NET if I could...)

Thank you.
Oct 25, 2013 at 8:38 PM
This is possible with Magick.NET, but you need to install Ghostscript (https://magick.codeplex.com/wikipage?title=Convert%20PDF). You can combine multiple images with the MagickImageCollection class. And then use another MagickImageCollection to combine them to a pdf file. To create a caption you could use the 'Annotate' method, you can find some more information about that here: http://www.imagemagick.org/Usage/annotating.

p.s. God of war arrived today, thank you very much.
Oct 25, 2013 at 9:47 PM
It was a small price to pay, but I hope that you enjoy the game. :)

I installed Ghostscript.NET and referenced it in my Console App project. It requires .NET Framework 4.0. As you recommend using 32-bit, I switch my project to target the .NET 4.0 Framework as well as x86. I had to change my Magick.NET reference to the appropriate version. There is nothing wrong with the Ghostscript.NET reference. However, now I am receiving an error indicating the Magick.NET reference cannot be found, even though I've checked all configuration settings for the Project, and verified the Magick.NET DLL and its corresponding XML file were copied to the bin folder of the Project.
Oct 25, 2013 at 10:05 PM
Edited Oct 25, 2013 at 10:08 PM
You don't have to switch to the x86 version of Magick.NET. You can just use the x86 version of Ghostscript with the x64 version of Magick.NET. I will update the page to explain this better.
Oct 25, 2013 at 10:10 PM
This worked a charm! Thank you.