处理演示文稿的大小和布局

SlideSize.TypeSlideSize.Size 是演示文稿类的属性,可以像下面的示例一样设置或获取。

示例


 string FilePath = @"..\..\..\Sample Files\";

string FileName = FilePath + "处理大小和布局.pptx";

//实例化一个表示演示文稿文件的 Presentation 对象

Presentation presentation = new Presentation(FileName);

Presentation auxPresentation = new Presentation();

ISlide slide = presentation.Slides[0];

//将生成的演示文稿的幻灯片大小设置为源文件的大小

auxPresentation.SlideSize.Type = presentation.SlideSize.Type;

auxPresentation.SlideSize.Size = presentation.SlideSize.Size;

auxPresentation.Slides.InsertClone(0, slide);

auxPresentation.Slides.RemoveAt(0);

//将演示文稿保存到磁盘

auxPresentation.Save(FileName, Aspose.Slides.Export.SaveFormat.Pptx);

下载示例代码

下载运行示例