我需要从 pptx 文件中的图像中检索图像文件名。我已经从图像中获得了流,但我没有获得图像文件的名称......这是我的代码:
private static Stream GetParagraphImage(DocumentFormat.OpenXml.Presentation.Picture picture, DocumentFormat.OpenXml.Packaging.PresentationDocument presentation, ref MyProject.Import.Office.PowerPoint.Presentation.Paragraph paragraph)
{
// Getting the image id
var imageId = picture.BlipFill.Blip.Embed.Value;
// Getting the stream of the image
var part = apresentacao.PresentationPart.GetPartById(idImagem);
var stream = part.GetStream();
// Getting the image name
var imageName = GetImageName(imageId, presentation);
/* Here i need a method that returns the image file name based on the id of the image and the presentation object.*/
// Setting my custom object ImageName property
paragraph.ImageName = imageName;
// Returning the stream
return stream;
}
任何人都知道我怎么能做到这一点?谢谢!!