Quantcast
Channel: magick Discussions Rss Feed
Viewing all articles
Browse latest Browse all 3693

New Post: The size of image is weird after convert a pdf to image.

$
0
0
It appears that your PDF file has a CropBox. You can enable the use of this with Magick.NET but I don't know what this will do with your other images. You will need to test that yourself. Below is the code that can be used to enable the CropBox and read a single page:
MagickReadSettings settings = new MagickReadSettings()
{
  Density = new Density(300), // Setting this value will get you an image with a higher quality 
  FrameIndex = 4, // Specifies the page you want to view (starts at zero)
  Defines = new PdfReadDefines()
  {
    UseCropBox = true// Enables the use of the CropBox.
  }
};

using (MagickImage image = new MagickImage("3P207257-2D.pdf", settings))
{
  image.Write("page.png");
}

Viewing all articles
Browse latest Browse all 3693

Trending Articles