Quantcast
Channel: Ghostscript.NET
Viewing all articles
Browse latest Browse all 393

New Post: Ghostscript for extracting pdf to jpeg images

$
0
0
Hi,
yes of course .

PdfReader PDFReader = new PdfReader(InputPath);
            int PDFPageCount = PDFReader.NumberOfPages;
            GhostscriptJpegDevice dev = new GhostscriptJpegDevice(GhostscriptJpegDeviceType.Jpeg);
            dev.GraphicsAlphaBits = GhostscriptImageDeviceAlphaBits.V_4;
            dev.TextAlphaBits = GhostscriptImageDeviceAlphaBits.V_4;
            dev.InputFiles.Add(InputPath);

            for (int index = 1; index <= PDFPageCount; index++)
            {
                dev.Pdf.FirstPage = index;
                dev.Pdf.LastPage = (index + 1);
                dev.OutputPath = Path.Combine(ghostFile, Path.GetFileName(index.ToString()) + ".Jpeg");
                dev.Process();

                pathes.Add(Path.Combine(ghostFile, Path.GetFileName(index.ToString()) + ".Jpeg"));

            }
            PDFReader.Close();



Thank you,
Aziza

Viewing all articles
Browse latest Browse all 393

Trending Articles



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