-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #56 from snehasf3509/master
Sample to merge PowerPoint slide with Source formatting
- Loading branch information
Showing
5 changed files
with
55 additions
and
0 deletions.
There are no files selected for viewing
25 changes: 25 additions & 0 deletions
25
...Point-slide-with-Source-formatting/.NET/Merge-PowerPoint-slide-with-Source-formatting.sln
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
|
||
Microsoft Visual Studio Solution File, Format Version 12.00 | ||
# Visual Studio Version 17 | ||
VisualStudioVersion = 17.4.33110.190 | ||
MinimumVisualStudioVersion = 10.0.40219.1 | ||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Merge-PowerPoint-slide-with-Source-formatting", "Merge-PowerPoint-slide-with-Source-formatting\Merge-PowerPoint-slide-with-Source-formatting.csproj", "{200E55BD-87C8-4D42-A14E-290C0AB1EF00}" | ||
EndProject | ||
Global | ||
GlobalSection(SolutionConfigurationPlatforms) = preSolution | ||
Debug|Any CPU = Debug|Any CPU | ||
Release|Any CPU = Release|Any CPU | ||
EndGlobalSection | ||
GlobalSection(ProjectConfigurationPlatforms) = postSolution | ||
{200E55BD-87C8-4D42-A14E-290C0AB1EF00}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
{200E55BD-87C8-4D42-A14E-290C0AB1EF00}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
{200E55BD-87C8-4D42-A14E-290C0AB1EF00}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
{200E55BD-87C8-4D42-A14E-290C0AB1EF00}.Release|Any CPU.Build.0 = Release|Any CPU | ||
EndGlobalSection | ||
GlobalSection(SolutionProperties) = preSolution | ||
HideSolutionNode = FALSE | ||
EndGlobalSection | ||
GlobalSection(ExtensibilityGlobals) = postSolution | ||
SolutionGuid = {5944F990-AC83-4E81-AEB9-28E7F2EE876D} | ||
EndGlobalSection | ||
EndGlobal |
Binary file added
BIN
+122 KB
...ting/.NET/Merge-PowerPoint-slide-with-Source-formatting/Data/DestinationPresentation.pptx
Binary file not shown.
Binary file added
BIN
+43.9 KB
...ormatting/.NET/Merge-PowerPoint-slide-with-Source-formatting/Data/SourcePresentation.pptx
Binary file not shown.
15 changes: 15 additions & 0 deletions
15
...erPoint-slide-with-Source-formatting/Merge-PowerPoint-slide-with-Source-formatting.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<OutputType>Exe</OutputType> | ||
<TargetFramework>net6.0</TargetFramework> | ||
<RootNamespace>Merge_PowerPoint_slide_with_Source_formatting</RootNamespace> | ||
<ImplicitUsings>enable</ImplicitUsings> | ||
<Nullable>enable</Nullable> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="Syncfusion.Presentation.NET" Version="*" /> | ||
</ItemGroup> | ||
|
||
</Project> |
15 changes: 15 additions & 0 deletions
15
...lide-with-Source-formatting/.NET/Merge-PowerPoint-slide-with-Source-formatting/Program.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
using Syncfusion.Presentation; | ||
|
||
//Load or open an PowerPoint Presentation. | ||
using FileStream sourcePresentationStream = new(Path.GetFullPath(@"../../../Data/SourcePresentation.pptx"), FileMode.Open, FileAccess.Read, FileShare.ReadWrite); | ||
using FileStream destinationPresentationStream = new(Path.GetFullPath(@"../../../Data/DestinationPresentation.pptx"), FileMode.Open, FileAccess.Read, FileShare.ReadWrite); | ||
//Open an existing PowerPoint presentation. | ||
using IPresentation sourcePresentation = Presentation.Open(sourcePresentationStream); | ||
//Open the destination Presentation. | ||
using IPresentation destinationPresentation = Presentation.Open(destinationPresentationStream); | ||
//Clone the first slide of the source Presentation. | ||
ISlide clonedSlide = sourcePresentation.Slides[0].Clone(); | ||
//Merge the cloned slide to the destination Presentation with paste option - Destination Theme. | ||
destinationPresentation.Slides.Add(clonedSlide, PasteOptions.SourceFormatting); | ||
using FileStream outputStream = new(Path.GetFullPath(@"../../../Result.pptx"), FileMode.Create, FileAccess.ReadWrite); | ||
destinationPresentation.Save(outputStream); |