Quality Resolution - Create a PDF file from two images:

Coordinator
Jul 19, 2013 at 6:28 PM
Copied from issue:

Hello, you can reduce the quality / resolution of the converted images to PDF? Using this code:

Create a PDF file from two images:

using (MagickImageCollection collection = new MagickImageCollection())
{

//Resolution ??????

collection.Add(new MagickImage("SnakewarePage1.jpg"));
collection.Add(new MagickImage("SnakewarePage2.jpg"));

collection.Write("Snakeware.pdf");
}


how can I insert value? thanks
Coordinator
Jul 19, 2013 at 6:31 PM
You have to set the resolution and the quality on the image. You cannot set it on the whole collection. It should be something like this:
using (MagickImageCollection collection = new MagickImageCollection())
{
  collection.Add(new MagickImage("SnakewarePage1.jpg"));
  collection[0].Density = new MagickGeometry(72, 72);
  collection.Add(new MagickImage("SnakewarePage2.jpg"));
  collection[1].Density = new MagickGeometry(72, 72);

  collection.Write("Snakeware.pdf");
}