public static void PDFToImg(){// 加载PDF文档 PdfDocument pdf = new PdfDocument();pdf.LoadFromFile("G:\\桌面文件\\图片\\放假\\端午节放假通知.pdf");List<Image> listImages = new List<Image>();for (int i = 0; i < pdf.Pages.Count; i++){// 实例化一个Spire.Pdf.PdfPageBase对象PdfPageBase page = pdf.Pages[i];// 获取所有pages里面的图片Image[] images = page.ExtractImages();if (images != null && images.Length > 0){listImages.AddRange(images);}}// 将提取到的图片保存到本地路径if (listImages.Count > 0){for (int i = 0; i < listImages.Count; i++){Image image = listImages[i];image.Save("G:\\桌面文件\\图片\\放假\\" + (i + 1).ToString() + ".png", System.Drawing.Imaging.ImageFormat.Png);}}// 释放PDF文档资源 pdf.Close();}