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

New Post: Converting a PDF to JPG and then scaling turns the image black

$
0
0
This happens with every PDF I try. Here's an example:

http://msiatlanta.com/kb/index.php?View=file&EntryID=3
        MagickReadSettings settings = new MagickReadSettings();
        settings.Density = new MagickGeometry(144, 144);
        foreach(string PDF in PDFs)
        {
            using(MagickImageCollection images = new MagickImageCollection())
            {
                images.Read(PDF, settings);
                int page = 1;
                foreach (MagickImage image in images)
                {
                    image.Write(PDF.Substring(0, PDF.Length - 4)+" Page "+page+".jpg");
                    page++;
                }
                images[0].Scale(95.0, 95.0);
                images[0].Write(PDF.Substring(0, PDF.Length - 4) + " High.jpg");
            }
        }
This code creates images of each PDF page and creates a scaled down image of the first page. However, the scaled down image turns black like so:

http://i.imgur.com/GuoWM0g.png

Viewing all articles
Browse latest Browse all 3693

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>