10
10
class Program
11
11
{
12
12
static void Main ( )
13
- {
13
+ {
14
14
/* Create new Presentation
15
15
Presentation presentation = Presentation.Create("D:\\AsposeSampleResults\\test2.pptx");
16
16
TextShape shape = new TextShape();
@@ -34,7 +34,32 @@ static void Main ()
34
34
presentation.AppendSlide(slide);
35
35
presentation.AppendSlide(slide1);
36
36
presentation.Save();*/
37
+ /*
38
+ Presentation presentation = Presentation.Create("D:\\AsposeSampleResults\\test2.pptx");
39
+ TextShape shape = new TextShape();
40
+ shape.Text = "Title: Here is my first title From FF";
41
+ shape.BackgroundColor = "5f7200";
42
+ shape.FontSize = 80;
43
+ shape.TextColor = "980078";
44
+ shape.FontFamily = "Baguet Script";
45
+ TextShape shape2 = new TextShape();
46
+
47
+ shape2.BackgroundColor = "ff7f90";
48
+ List<TextSegment> TextSegments = new List<TextSegment>();
49
+ TextSegments.Add(new TextSegment{Color= "980078", FontSize = 70, FontFamily = "Calibri", Text = "Body:" }.create());
50
+ TextSegments.Add(new TextSegment{ Color = "000000", FontSize = 32, FontFamily = "Baguet Script", Text = " Here is my text Segment" }.create());
51
+
52
+ shape2.Y = Utility.EmuToPixels(3499619);
53
+ // First slide
54
+ Slide slide = new Slide();
55
+ slide.AddTextShapes(shape);
56
+ slide.AddTextShapes(shape2, TextSegments);
37
57
58
+ // Adding slides
59
+ presentation.AppendSlide(slide);
60
+
61
+ presentation.Save();*/
62
+
38
63
/* Open and update a PPTX file
39
64
Presentation presentation = Presentation.Open("D:\\AsposeSampleData\\sample.pptx");
40
65
var slides = presentation.GetSlides();
@@ -56,7 +81,7 @@ static void Main ()
56
81
Console.WriteLine(confirmation);
57
82
presentation.Save();
58
83
*/
59
-
84
+
60
85
/*
61
86
* Remove text shape from a slide
62
87
Presentation presentation = Presentation.Open("D:\\AsposeSampleData\\sample.pptx");
@@ -69,7 +94,7 @@ static void Main ()
69
94
70
95
71
96
/*
72
- * Add slide to an existing presentation
97
+ // Add slide to an existing presentation
73
98
Presentation presentation = Presentation.Open("D:\\AsposeSampleData\\sample.pptx");
74
99
TextShape shape1 = new TextShape();
75
100
shape1.Text = "Body : Here is my first title From FF";
@@ -108,6 +133,51 @@ static void Main ()
108
133
presentation.ExtractAndSaveImages("testing images"); */
109
134
110
135
136
+ /*
137
+ //Update an image in a slide
138
+ Presentation presentation = Presentation.Open("D:\\AsposeSampleData\\sample.pptx");
139
+ var slides = presentation.GetSlides();
140
+ var slide = slides[0];
141
+ var shape = slide.TextShapes[0];
142
+ shape.BackgroundColor = "7f7f88";
143
+ shape.Text = "Updated 2nd Text";
144
+ shape.Update();
145
+ Slide slide1 = new Slide();
146
+ slide1.BackgroundColor = Colors.Green;
147
+ Image image1 = new Image("D:\\AsposeSampleData\\target.png");
148
+ image1.X = Utility.EmuToPixels(1838700);
149
+ image1.Y = Utility.EmuToPixels(1285962);
150
+ image1.Width = Utility.EmuToPixels(2514600);
151
+ image1.Height = Utility.EmuToPixels(2886075);
152
+ slide1.AddImage(image1);
153
+
154
+ presentation.AppendSlide(slide1);
155
+ presentation.Save();
156
+ */
157
+ /*
158
+ * Add bulleted list.
159
+ Presentation presentation = Presentation.Create("D:\\AsposeSampleResults\\test2.pptx");
160
+ Slide slide1 = new Slide();
161
+ slide1.BackgroundColor = Colors.Purple;
162
+ TextShape shape1 = new TextShape();
163
+ shape1.FontFamily = "Baguet Script";
164
+ shape1.FontSize = 60;
165
+ shape1.Y = 200.0;
166
+ shape1.TextColor = Colors.Yellow;
167
+ shape1.BackgroundColor = Colors.LimeGreen;
168
+
169
+ StyledList list = new StyledList();
170
+ list.AddListItem("Pakistan");
171
+ list.AddListItem("India");
172
+ list.AddListItem("Australia");
173
+ list.AddListItem("England");
174
+
175
+ shape1.TextList = list;
176
+ slide1.AddTextShapes(shape1);
177
+
178
+ presentation.AppendSlide(slide1);
179
+ presentation.Save();
180
+ */
111
181
112
182
113
183
}
0 commit comments