Skip to content

Commit f57de4e

Browse files
Zeeshan ShafqatZeeshan Shafqat
authored andcommitted
Restructuring of Aspose VS OpenXML
1 parent cc261a6 commit f57de4e

File tree

167 files changed

+1029
-850
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

167 files changed

+1029
-850
lines changed

Plugins/OpenXML/Common Features/Add a comment to a slide/Add a comment to a slide.sln

Lines changed: 0 additions & 26 deletions
This file was deleted.

Plugins/OpenXML/Common Features/Add a comment to a slide/Aspose Slides/Aspose Slides.csproj

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,9 @@
3232
<WarningLevel>4</WarningLevel>
3333
</PropertyGroup>
3434
<ItemGroup>
35-
<Reference Include="Aspose.Slides">
36-
<HintPath>..\..\..\Dlls\Aspose.Slides.dll</HintPath>
35+
<Reference Include="Aspose.Slides, Version=16.4.0.0, Culture=neutral, PublicKeyToken=716fcc553a201e56, processorArchitecture=MSIL">
36+
<SpecificVersion>False</SpecificVersion>
37+
<HintPath>..\..\packages\Aspose.Slides.NET.16.4.0\lib\net4.0-client\Aspose.Slides.dll</HintPath>
3738
</Reference>
3839
<Reference Include="System" />
3940
<Reference Include="System.Core" />
@@ -50,6 +51,7 @@
5051
</ItemGroup>
5152
<ItemGroup>
5253
<None Include="App.config" />
54+
<None Include="packages.config" />
5355
</ItemGroup>
5456
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
5557
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.

Plugins/OpenXML/Common Features/Add a comment to a slide/Aspose Slides/Program.cs

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,28 @@
11
// Copyright (c) Aspose 2002-2014. All Rights Reserved.
22

3+
using Aspose.Slides;
34
using System;
45
using System.Drawing;
5-
using Aspose.Slides.Pptx;
66

7-
namespace Aspose_Slides
7+
/*
8+
This project uses Automatic Package Restore feature of NuGet to resolve Aspose.Slides for .NET API reference when the project is build. Please check https://docs.nuget.org/consume/nuget-faq for more information. If you do not wish to use NuGet, you can manually download Aspose.Slides for .NET API from http://www.aspose.com/downloads, install it and then add its reference to this project. For any issues, questions or suggestions please feel free to contact us using http://www.aspose.com/community/forums/default.aspx
9+
*/
10+
namespace Aspose.Plugins.AsposeVSOpenXML
811
{
912
class Program
1013
{
1114
static void Main(string[] args)
1215
{
13-
14-
using (PresentationEx pres = new PresentationEx())
16+
string FilePath = @"..\..\..\..\Sample Files\";
17+
string FileName = FilePath + "Add a comment to a slide.pptx";
18+
19+
using (Presentation pres = new Presentation())
1520
{
1621
//Adding Empty slide
1722
pres.Slides.AddEmptySlide(pres.LayoutSlides[0]);
1823

1924
//Adding Autthor
20-
CommentAuthorEx author = pres.CommentAuthors.AddAuthor("Zeeshan", "MZ");
25+
ICommentAuthor author = pres.CommentAuthors.AddAuthor("Zeeshan", "MZ");
2126

2227
//Position of comments
2328

@@ -27,7 +32,7 @@ static void Main(string[] args)
2732

2833
//Adding slide comment for an author on slide
2934
author.Comments.AddComment("Hello Zeeshan, this is slide comment", pres.Slides[0], point, DateTime.Now);
30-
pres.Write("Comments.pptx");
35+
pres.Save(FileName, Aspose.Slides.Export.SaveFormat.Pptx);
3136
}
3237
}
3338
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<packages>
3+
<package id="Aspose.Slides.NET" version="16.4.0" targetFramework="net45" />
4+
</packages>

Plugins/OpenXML/Common Features/Add a comment to a slide/OpenXml Presentation/Program.cs

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,20 @@
11
// Copyright (c) Aspose 2002-2014. All Rights Reserved.
22

3-
using System;
4-
using System.Linq;
53
using DocumentFormat.OpenXml.Packaging;
64
using DocumentFormat.OpenXml.Presentation;
5+
using System;
6+
using System.Linq;
77

8-
namespace OpenXml_Presentation
8+
namespace Aspose.Plugins.AsposeVSOpenXML
99
{
1010
class Program
1111
{
1212
static void Main(string[] args)
1313
{
14-
AddCommentToPresentation("Sample.pptx",
14+
string FilePath = @"..\..\..\..\Sample Files\";
15+
string FileName = FilePath + "Add a comment to a slide.pptx";
16+
17+
AddCommentToPresentation(FileName,
1518
"Zeeshan", "MZ",
1619
"This is my programmatically added comment.");
1720

Plugins/OpenXML/Common Features/Adding Slide to Presentation/Adding Slide to Presentation.sln

Lines changed: 0 additions & 26 deletions
This file was deleted.

Plugins/OpenXML/Common Features/Adding Slide to Presentation/Aspose Slides/Aspose Slides.csproj

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
</PropertyGroup>
3434
<ItemGroup>
3535
<Reference Include="Aspose.Slides">
36-
<HintPath>..\..\..\Dlls\Aspose.Slides.dll</HintPath>
36+
<HintPath>..\..\packages\Aspose.Slides.NET.16.4.0\lib\net4.0-client\Aspose.Slides.dll</HintPath>
3737
</Reference>
3838
<Reference Include="System" />
3939
<Reference Include="System.Core" />
@@ -49,6 +49,7 @@
4949
</ItemGroup>
5050
<ItemGroup>
5151
<None Include="App.config" />
52+
<None Include="packages.config" />
5253
</ItemGroup>
5354
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
5455
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.

Plugins/OpenXML/Common Features/Adding Slide to Presentation/Aspose Slides/Program.cs

Lines changed: 10 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -2,47 +2,31 @@
22

33
using Aspose.Slides;
44

5-
namespace Aspose_Slides
5+
/*
6+
This project uses Automatic Package Restore feature of NuGet to resolve Aspose.Slides for .NET API reference when the project is build. Please check https://docs.nuget.org/consume/nuget-faq for more information. If you do not wish to use NuGet, you can manually download Aspose.Slides for .NET API from http://www.aspose.com/downloads, install it and then add its reference to this project. For any issues, questions or suggestions please feel free to contact us using http://www.aspose.com/community/forums/default.aspx
7+
*/
8+
namespace Aspose.Plugins.AsposeVSOpenXML
69
{
710
class Program
811
{
912
static void Main(string[] args)
1013
{
14+
string FilePath = @"..\..\..\..\Sample Files\";
15+
string FileName = FilePath + "Adding Slide to Presentation.pptx";
16+
1117
//Instantiate PresentationEx class that represents the PPT file
1218
Presentation pres = new Presentation();
1319

1420
//Blank slide is added by default, when you create
1521
//presentation from default constructor
1622
//Adding an empty slide to the presentation and getting the reference of
1723
//that empty slide
18-
Slide slide = pres.AddEmptySlide();
24+
ISlide slide = pres.Slides.AddEmptySlide(pres.LayoutSlides[0]);
1925

20-
slide = pres.GetSlideByPosition(2);
21-
22-
//Get the font index for Arial
23-
//It is always 0 if you create presentation from
24-
//default constructor
25-
int arialFontIndex = 0;
26-
27-
//Add a textbox
28-
//To add it, we will first add a rectangle
29-
Shape shp = slide.Shapes.AddRectangle(1200, 800, 3200, 370);
30-
31-
//Hide its line
32-
shp.LineFormat.ShowLines = false;
33-
34-
//Then add a textframe inside it
35-
TextFrame tf = shp.AddTextFrame("");
36-
37-
//Set a text
38-
tf.Text = "Text added dynamically";
39-
Portion port = tf.Paragraphs[0].Portions[0];
40-
port.FontIndex = arialFontIndex;
41-
port.FontBold = true;
42-
port.FontHeight = 32;
26+
4327

4428
//Write the output to disk
45-
pres.Write("outAspose.ppt");
29+
pres.Save(FileName,Aspose.Slides.Export.SaveFormat.Pptx);
4630

4731
}
4832
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<packages>
3+
<package id="Aspose.Slides.NET" version="16.4.0" targetFramework="net45" />
4+
</packages>

Plugins/OpenXML/Common Features/Adding Slide to Presentation/OpenXML Presentation/Program.cs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,20 @@
11
// Copyright (c) Aspose 2002-2014. All Rights Reserved.
22

3-
using System;
43
using DocumentFormat.OpenXml.Packaging;
54
using DocumentFormat.OpenXml.Presentation;
5+
using System;
66
using Drawing = DocumentFormat.OpenXml.Drawing;
77

8-
namespace OpenXML_Presentation
8+
namespace Aspose.Plugins.AsposeVSOpenXML
99
{
1010
class Program
1111
{
1212
static void Main(string[] args)
1313
{
14-
InsertNewSlide("Sample.pptx", 1, "My new slide");
14+
string FilePath = @"..\..\..\..\Sample Files\";
15+
string FileName = FilePath + "Adding Slide to Presentation.pptx";
16+
17+
InsertNewSlide(FileName, 1, "My new slide");
1518
}
1619
// Insert a slide into the specified presentation.
1720
public static void InsertNewSlide(string presentationFile, int position, string slideTitle)

0 commit comments

Comments
 (0)