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
Hi, thank you for such nice library!
I've read examples and now trying to convert PDF to a set of progressive JPG files, but i didn't succeed.
MagickReadSettings settings = new MagickReadSettings();
settings.Density = new MagickGeometry(144, 144);

settings.ColorSpace = ColorSpace.sRGB;

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

    coverPage.Quality = 80;

    coverPage.Read(fileName + "[0]", settings);
    
    coverPage.Write(WritePath);
}
Image is not saved as PJPEG. It works only when i add PJPEG: before filepath.
string WritePath = String.Format("PJPEG:{0}.jpg", OutPath);
I can go this way, but there is other issue: i want to have output images of fixed size (max height ~500px)

when i try to call
coverPage.Resize(0, 500);
before saving image, it sized but have a black background:

Image

what am i doing wrong? what is the best way to solve this?

Regards,
Denis

Viewing all articles
Browse latest Browse all 3693

Trending Articles