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

New Post: Convert PDF to a set of PJPEG files

$
0
0
Very interesting, everything okay when i first save PDF page as image, reopen it and perform needed actions:
MagickReadSettings settings = new MagickReadSettings();

settings.Density = new MagickGeometry(144, 144);

// 1 step - read PDF first page, and save it as JPEG image

using (MagickImage coverPage = new MagickImage())
{
    coverPage.Read(fileName + "[0]", settings);

    coverPage.Write(WritePath);
}

// 2 step - reopen just created file, resize and overwrite

using (MagickImage image = new MagickImage(WritePath))
{
    image.Format = MagickFormat.Pjpeg;

    // max height = 500px, width is calculated by library
    image.Resize(0, 500);

    image.Write(WritePath);
}
anyway, thanks for such good library!

Viewing all articles
Browse latest Browse all 3693

Trending Articles