Skip to content

Commit 2bb25cc

Browse files
Publish v23.12.0
1 parent ea939a3 commit 2bb25cc

File tree

12 files changed

+712
-424
lines changed

12 files changed

+712
-424
lines changed

FileFormat.Slides-Test/Program.cs

+73-3
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
class Program
1111
{
1212
static void Main ()
13-
{
13+
{
1414
/* Create new Presentation
1515
Presentation presentation = Presentation.Create("D:\\AsposeSampleResults\\test2.pptx");
1616
TextShape shape = new TextShape();
@@ -34,7 +34,32 @@ static void Main ()
3434
presentation.AppendSlide(slide);
3535
presentation.AppendSlide(slide1);
3636
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);
3757
58+
// Adding slides
59+
presentation.AppendSlide(slide);
60+
61+
presentation.Save();*/
62+
3863
/* Open and update a PPTX file
3964
Presentation presentation = Presentation.Open("D:\\AsposeSampleData\\sample.pptx");
4065
var slides = presentation.GetSlides();
@@ -56,7 +81,7 @@ static void Main ()
5681
Console.WriteLine(confirmation);
5782
presentation.Save();
5883
*/
59-
84+
6085
/*
6186
* Remove text shape from a slide
6287
Presentation presentation = Presentation.Open("D:\\AsposeSampleData\\sample.pptx");
@@ -69,7 +94,7 @@ static void Main ()
6994

7095

7196
/*
72-
* Add slide to an existing presentation
97+
// Add slide to an existing presentation
7398
Presentation presentation = Presentation.Open("D:\\AsposeSampleData\\sample.pptx");
7499
TextShape shape1 = new TextShape();
75100
shape1.Text = "Body : Here is my first title From FF";
@@ -108,6 +133,51 @@ static void Main ()
108133
presentation.ExtractAndSaveImages("testing images"); */
109134

110135

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+
*/
111181

112182

113183
}

0 commit comments

Comments
 (0)