Presentation presentation = new Presentation(@"C:\Users\Administrator\Desktop\sample.pptx", FileFormat.Pptx2010);
StringBuilder sb = new StringBuilder();
foreach (ISlide slide in presentation.Slides)
{
foreach (IShape shape in slide.Shapes)
{
if (shape is IAutoShape)
{
foreach (TextParagraph tp in (shape as IAutoShape).TextFrame.Paragraphs)
{
sb.Append(tp.Text + Environment.NewLine);
}
}
}
}
File.WriteAllText("target.txt", sb.ToString());
Process.Start("target.txt");
Presentation ppt = new Presentation(); ppt.LoadFromFile(@"C:\Users\Administrator\Desktop\sample.pptx");
for (int i = 0; i < ppt.Images.Count; i++)
{
Image image = ppt.Images[i].Image;
image.Save(string.Format(@"..\..\Images{0}.png", i));
}
Presentation PPT = new Presentation(); PPT.LoadFromFile(@"C:\Users\Administrator\Desktop\sample.pptx");
int i = 0;
foreach (IShape s in PPT.Slides[2].Shapes)
{
if (s is SlidePicture)
{
SlidePicture ps = s as SlidePicture;
ps.PictureFill.Picture.EmbedImage.Image.Save(string.Format("{0}.png", i));
i++;
}
if (s is PictureShape)
{
PictureShape ps = s as PictureShape;
ps.EmbedImage.Image.Save(string.Format("{0}.png", i));
i++;
}
}
机械节能产品生产企业官网模板...
大气智能家居家具装修装饰类企业通用网站模板...
礼品公司网站模板
宽屏简约大气婚纱摄影影楼模板...
蓝白WAP手机综合医院类整站源码(独立后台)...苏ICP备2024110244号-2 苏公网安备32050702011978号 增值电信业务经营许可证编号:苏B2-20251499 | Copyright 2018 - 2025 源码网商城 (www.ymwmall.com) 版权所有