/// <summary>
/// 提取word中的图片
/// </summary>
/// <param name="filePath">word文件路径</param>
/// <param name="savePath">保存文件路径</param>
/// <returns></returns>
public static List<string> ExportImageFromWordFile(string filePath, string savePath = "")
{
if (!File.Exists(filePath)) return new List<string>();
if (string.IsNullOrEmpty(savePath)) savePath = AppDomain.CurrentDomain.BaseDirectory;
//文件名集合
List<string> list = new List<string>();
//加载word
Document doc = new Document(filePath);
NodeCollection shapes = doc.GetChildNodes(NodeType.Shape, true);
int imageIndex = 0;
foreac
Aspose.Words提取word文档中的图片文件
最新推荐文章于 2024-06-11 20:48:39 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)