本文整理汇总了C#中Presentation.AddEmptySlide方法的典型用法代码示例。如果您正苦于以下问题:C# Presentation.AddEmptySlide方法的具体用法?C# Presentation.AddEmptySlide怎么用?C# Presentation.AddEmptySlide使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Presentation
的用法示例。
在下文中一共展示了Presentation.AddEmptySlide方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Main
static void Main(string[] args)
{
//Instantiate PresentationEx class that represents the PPT file
Presentation pres = new Presentation();
//Blank slide is added by default, when you create
//presentation from default constructor
//Adding an empty slide to the presentation and getting the reference of
//that empty slide
Slide slide = pres.AddEmptySlide();
slide = pres.GetSlideByPosition(2);
//Get the font index for Arial
//It is always 0 if you create presentation from
//default constructor
int arialFontIndex = 0;
//Add a textbox
//To add it, we will first add a rectangle
Shape shp = slide.Shapes.AddRectangle(1200, 800, 3200, 370);
//Hide its line
shp.LineFormat.ShowLines = false;
//Then add a textframe inside it
TextFrame tf = shp.AddTextFrame("");
//Set a text
tf.Text = "Text added dynamically";
Portion port = tf.Paragraphs[0].Portions[0];
port.FontIndex = arialFontIndex;
port.FontBold = true;
port.FontHeight = 32;
//Write the output to disk
pres.Write("outAspose.ppt");
}