使用 Pdf2Image 将 pdf 转换为位图 [.png] 时性能不佳

Bad performance while converting pdf to Bitmap [.png] using Pdf2Image

让我解释一下,假设我上传的 pdf 有 20 页,然后我们将 pdf 转换为单页,然后再转换为 .png。所以需要太多时间。现在 20 页这段代码需要 2 分钟

string result = Path.Combine(Server.MapPath("~/TempSplitPDF")) + "/result";
for (int j = 1; j <= pdfReader.NumberOfPages; j++)
{                   
    Bitmap imagelst = new Pdf2Image(result + j + ".pdf").GetImage();
}                                                                        
imageModal = new ImageModel();                                
imageModal.FileName = Guid.NewGuid().ToString() + ".png";

请哪位大侠帮帮我!

这段代码对我来说性能非常快。

GhostscriptPngDevice dev = new GhostscriptPngDevice(GhostscriptPngDeviceType.Png256);
dev.GraphicsAlphaBits = GhostscriptImageDeviceAlphaBits.V_4;
dev.TextAlphaBits = GhostscriptImageDeviceAlphaBits.V_4;
dev.ResolutionXY = new GhostscriptImageDeviceResolution(290, 290);
dev.InputFiles.Add(result + j + ".pdf");
dev.Pdf.FirstPage = 1;
dev.Pdf.LastPage = 1;
dev.PostScript = string.Empty;
dev.OutputPath = Server.MapPath(@"~/TempPDF" + "\" + imageModal.FileName);
dev.Process();