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

New Post: Not converting to PDF properly

$
0
0
Using this image: https://www.dropbox.com/s/vfli58sxzmywcy3/22525_008_0030_CC.tif

In the following code, on the last line, the format of the image(magickImageNew ) is .png when it should be .pdf:
        var destinationStream = new FileStream("test.pdf", FileMode.Create);

        //this is the image in dropbox
        string sourceFilePath = @"C:\22525_008_0030_CC.tif";

        MagickImage magickImage1 = new MagickImage(sourceFilePath);

        magickImage1.Strip();
        magickImage1.Format = MagickFormat.Pdf;
        magickImage1.Density = new MagickGeometry(300, 300);

        destinationStream.SetLength(0);
        magickImage1.Write(destinationStream);

        MagickImage magickImageNew;

        destinationStream.Seek(0, SeekOrigin.Begin);
        magickImageNew = new MagickImage(destinationStream);
Let me know if you need more information or if I am missing something.

Thanks, Tim

Viewing all articles
Browse latest Browse all 3693

Trending Articles



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