In my software I make 2 pdf files from 1 using iTextSharp. I'd like to convert these files in 2 different PNG images using GS, but something strange happens. I use this code for the conversion:
When I look at the second image with the same file name as newFilePath2 with .png instead of .pdf, it has the image of the newFilePath1 pdf file.
How can I solve this problem?
GhostscriptRasterizer rasterizer = new GhostscriptRasterizer();
rasterizer.Open(newFilePath1, gsInfo, false);
Image image = rasterizer.GetPage(300, 300, 1);
image.Save(subDirPath + serCod + "_S1.png");
rasterizer.Close();
rasterizer.Open(newFilePath2, gsInfo, false);
image = rasterizer.GetPage(300, 300, 1);
image.Save(subDirPath + serCod + "_S2.png");
rasterizer.Close();
When I save the first image it shows like a blank page and the file name is the same of newFilePath1 without .pdf but with .png.When I look at the second image with the same file name as newFilePath2 with .png instead of .pdf, it has the image of the newFilePath1 pdf file.
How can I solve this problem?