I\'ve been using ghostscript to do pdf to image generation of a single page from the pdf. Now I need to be able to pull multiple pages from the pdf and produce a long vertical
I ended up adding "%d" to the "OutputFile" parameter so that it would generate one file per page. Then I just read up all of the files and stitched them together in my c# code like so:
var images =pdf.GetPreview(1,8); //All of the individual images read in one per file
using (Bitmap b = new Bitmap(images[0].Width, images.Sum(img=>img.Height))) {
using (var g = Graphics.FromImage(b)) {
for (int i = 0; i < images.Count; i++) {
g.DrawImageUnscaled(images[i], 0, images.Take(i).Sum(img=>img.Height));
}
}
//Do Stuff
}