Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,13 @@
<PackageReference Include="Syncfusion.Presentation.NET" Version="*" />
</ItemGroup>

<ItemGroup>
<None Update="Data\Template.pptm">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="Output\.gitkeep">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
using Syncfusion.Presentation;

//Load or open an PowerPoint Presentation.
using FileStream inputStream = new(Path.GetFullPath(@"../../../Data/Template.pptm"), FileMode.Open, FileAccess.Read, FileShare.ReadWrite);
using FileStream inputStream = new(Path.GetFullPath(@"Data/Template.pptm"), FileMode.Open, FileAccess.Read, FileShare.ReadWrite);
//Open an existing PowerPoint presentation.
using IPresentation pptxDoc = Presentation.Open(inputStream);
//Add a blank slide to the presentation.
ISlide slide = pptxDoc.Slides.Add(SlideLayoutType.Blank);
//Add a text box to the slide.
IParagraph paragraph = slide.Shapes.AddTextBox(100, 100, 300, 80).TextBody.AddParagraph("Preserve Macros");
//Save the PowerPoint Presentation as stream.
using FileStream outputStream = new(Path.GetFullPath(@"../../../Result.pptm"), FileMode.Create, FileAccess.ReadWrite);
using FileStream outputStream = new(Path.GetFullPath(@"Output/Result.pptm"), FileMode.Create, FileAccess.ReadWrite);
pptxDoc.Save(outputStream);
Empty file.
4 changes: 2 additions & 2 deletions Macros/Remove-macros/.NET/Remove-macros/Program.cs
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
using Syncfusion.Presentation;

//Load or open an PowerPoint Presentation.
using FileStream inputStream = new(Path.GetFullPath(@"../../../Data/Template.pptm"), FileMode.Open, FileAccess.Read, FileShare.ReadWrite);
using FileStream inputStream = new(Path.GetFullPath(@"Data/Template.pptm"), FileMode.Open, FileAccess.Read, FileShare.ReadWrite);
//Open an existing PowerPoint presentation.
using IPresentation pptxDoc = Presentation.Open(inputStream);
//Check whether the presentation has macros and then removes them.
if (pptxDoc.HasMacros)
pptxDoc.RemoveMacros();
//Save the PowerPoint Presentation as stream.
using FileStream outputStream = new(Path.GetFullPath(@"../../../Result.pptx"), FileMode.Create, FileAccess.ReadWrite);
using FileStream outputStream = new(Path.GetFullPath(@"Output/Result.pptx"), FileMode.Create, FileAccess.ReadWrite);
pptxDoc.Save(outputStream);
9 changes: 9 additions & 0 deletions Macros/Remove-macros/.NET/Remove-macros/Remove-macros.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,13 @@
<PackageReference Include="Syncfusion.Presentation.NET" Version="*" />
</ItemGroup>

<ItemGroup>
<None Update="Data\Template.pptm">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="Output\.gitkeep">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,10 @@
<PackageReference Include="Syncfusion.Presentation.NET" Version="*" />
</ItemGroup>

<ItemGroup>
<None Update="Output\.gitkeep">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@
//Get the first shape name from the master slide.
string shapeName = masterSlide.Shapes[0].ShapeName;
//Save the PowerPoint Presentation as stream.
using FileStream outputStream = new(Path.GetFullPath(@"../../../Result.pptx"), FileMode.Create, FileAccess.ReadWrite);
using FileStream outputStream = new(Path.GetFullPath(@"Output/Result.pptx"), FileMode.Create, FileAccess.ReadWrite);
pptxDoc.Save(outputStream);
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,10 @@
<PackageReference Include="Syncfusion.Presentation.NET" Version="*" />
</ItemGroup>

<ItemGroup>
<None Update="Output\.gitkeep">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@
//Change the background color for LayoutSlide.
layoutSlide.Background.Fill.SolidFill.Color = ColorObject.FromArgb(78, 89, 90);
//Save the PowerPoint Presentation as stream.
using FileStream outputStream = new(Path.GetFullPath(@"../../../Result.pptx"), FileMode.Create, FileAccess.ReadWrite);
using FileStream outputStream = new(Path.GetFullPath(@"Output/Result.pptx"), FileMode.Create, FileAccess.ReadWrite);
pptxDoc.Save(outputStream);
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,10 @@
<PackageReference Include="Syncfusion.Presentation.NET" Version="*" />
</ItemGroup>

<ItemGroup>
<None Update="Output\.gitkeep">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@
//Set the color for solid fill object.
solidFill.Color = ColorObject.Green;
//Save the PowerPoint Presentation as stream.
using FileStream outputStream = new(Path.GetFullPath(@"../../../Result.pptx"), FileMode.Create, FileAccess.ReadWrite);
using FileStream outputStream = new(Path.GetFullPath(@"Output/Result.pptx"), FileMode.Create, FileAccess.ReadWrite);
pptxDoc.Save(outputStream);
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,10 @@
<PackageReference Include="Syncfusion.Presentation.NET" Version="*" />
</ItemGroup>

<ItemGroup>
<None Update="Output\.gitkeep">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@
INotesSlide notesSlide = slide.AddNotesSlide();
//Add text content into the Notes Slide.
notesSlide.NotesTextBody.AddParagraph("Notes content");
using FileStream outputStream = new(Path.GetFullPath(@"../../../Result.pptx"), FileMode.Create, FileAccess.ReadWrite);
using FileStream outputStream = new(Path.GetFullPath(@"Output/Result.pptx"), FileMode.Create, FileAccess.ReadWrite);
pptxDoc.Save(outputStream);
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,10 @@
<PackageReference Include="Syncfusion.Presentation.NET" Version="*" />
</ItemGroup>

<ItemGroup>
<None Update="Output\.gitkeep">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
</ItemGroup>

</Project>
Empty file.
2 changes: 1 addition & 1 deletion Notes/Add-text-in-notes/.NET/Add-text-in-notes/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,5 @@
textPart.Font.FontName = "Times New Roman";
//Set text content size using FontSize property.
textPart.Font.FontSize = 20;
using FileStream outputStream = new(Path.GetFullPath(@"../../../Result.pptx"), FileMode.Create, FileAccess.ReadWrite);
using FileStream outputStream = new(Path.GetFullPath(@"Output/Result.pptx"), FileMode.Create, FileAccess.ReadWrite);
pptxDoc.Save(outputStream);
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,10 @@
<PackageReference Include="Syncfusion.Presentation.NET" Version="*" />
</ItemGroup>

<ItemGroup>
<None Update="Output\.gitkeep">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,5 @@
//Set the bullet character size. Here, 100 means 100% of its text. Possible values can range from 25 to 400.
paragraph.ListFormat.Size = 100;
//Save the PowerPoint Presentation as stream.
using FileStream outputStream = new(Path.GetFullPath(@"../../../Result.pptx"), FileMode.Create, FileAccess.ReadWrite);
using FileStream outputStream = new(Path.GetFullPath(@"Output/Result.pptx"), FileMode.Create, FileAccess.ReadWrite);
pptxDoc.Save(outputStream);
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
using Syncfusion.Presentation;

//Load or open an PowerPoint Presentation.
using FileStream inputStream = new(Path.GetFullPath(@"../../../Data/Template.pptx"), FileMode.Open, FileAccess.Read, FileShare.ReadWrite);
using FileStream inputStream = new(Path.GetFullPath(@"Data/Template.pptx"), FileMode.Open, FileAccess.Read, FileShare.ReadWrite);
//Open an existing PowerPoint presentation.
using IPresentation pptxDoc = Presentation.Open(inputStream);
//Get instance of the first slide from the Presentation.
ISlide slide = pptxDoc.Slides[0] as ISlide;
//Remove Notes Slide from a corresponding slide.
slide.RemoveNotesSlide();
//Save the PowerPoint Presentation as stream.
using FileStream outputStream = new(Path.GetFullPath(@"../../../Result.pptx"), FileMode.Create, FileAccess.ReadWrite);
using FileStream outputStream = new(Path.GetFullPath(@"Output/Result.pptx"), FileMode.Create, FileAccess.ReadWrite);
pptxDoc.Save(outputStream);
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,13 @@
<PackageReference Include="Syncfusion.Presentation.NET" Version="*" />
</ItemGroup>

<ItemGroup>
<None Update="Data\Template.pptx">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="Output\.gitkeep">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
</ItemGroup>

</Project>