Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modify Presentation GitHub examples repository for document processing playground #73

Merged
merged 19 commits into from
Aug 21, 2024
Merged
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 @@ -10,5 +10,5 @@
ISequence sequence = slide.Timeline.MainSequence;
//Add bounce effect to the shape.
IEffect bounceEffect = sequence.AddEffect(cubeShape, EffectType.Bounce, EffectSubtype.None, EffectTriggerType.OnClick);
using FileStream outputStream = new(Path.GetFullPath(@"../../../Result.pptx"), FileMode.Create, FileAccess.ReadWrite);
using FileStream outputStream = new(Path.GetFullPath(@"Output/Output.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>
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
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);
//Retrieve the first slide from Presentation.
Expand All @@ -12,5 +12,5 @@
ISequence sequence = slide.Timeline.MainSequence;
//Add swivel effect with vertical subtype to the shape, build type is used to represent the animate level of the paragraph.
IEffect bounceEffect = sequence.AddEffect(shape, EffectType.Swivel, EffectSubtype.Vertical, EffectTriggerType.OnClick, BuildType.ByLevelParagraphs1);
using FileStream outputStream = new(Path.GetFullPath(@"../../../Result.pptx"), FileMode.Create, FileAccess.ReadWrite);
using FileStream outputStream = new(Path.GetFullPath(@"Output/Output.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 @@ -12,5 +12,5 @@
IEffect effect = sequence.AddEffect(cubeShape, EffectType.RandomBars, EffectSubtype.None, EffectTriggerType.OnClick);
//Change the preset class type of the effect from default entrance to exit.
effect.PresetClassType = EffectPresetClassType.Exit;
using FileStream outputStream = new(Path.GetFullPath(@"../../../Result.pptx"), FileMode.Create, FileAccess.ReadWrite);
using FileStream outputStream = new(Path.GetFullPath(@"Output/Output.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 @@ -12,5 +12,5 @@
ISequence interactiveSequence = slide.Timeline.InteractiveSequences.Add(buttonShape);
//Add Fly effect with top subtype to animate the shape as fly from top.
IEffect bounceEffect = interactiveSequence.AddEffect(cubeShape, EffectType.Fly, EffectSubtype.Top, EffectTriggerType.OnClick);
using FileStream outputStream = new(Path.GetFullPath(@"../../../Result.pptx"), FileMode.Create, FileAccess.ReadWrite);
using FileStream outputStream = new(Path.GetFullPath(@"Output/Output.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 @@ -22,5 +22,5 @@
motionBehavior.Path.Add(MotionCommandPathType.LineTo, points, MotionPathPointsType.Auto, false);
//Add the end command to finish the path animation.
motionBehavior.Path.Add(MotionCommandPathType.End, null, MotionPathPointsType.Auto, false);
using FileStream outputStream = new(Path.GetFullPath(@"../../../Result.pptx"), FileMode.Create, FileAccess.ReadWrite);
using FileStream outputStream = new(Path.GetFullPath(@"Output/Output.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>
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
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);
//Retrieve the first slide from Presentation.
Expand All @@ -14,5 +14,5 @@
IEffect wheelEffect = sequence[0] as IEffect;
//Change the wheel animation effect sub type from 2 spoke to 4 spoke.
wheelEffect.Subtype = EffectSubtype.Wheel4;
using FileStream outputStream = new(Path.GetFullPath(@"../../../Result.pptx"), FileMode.Create, FileAccess.ReadWrite);
using FileStream outputStream = new(Path.GetFullPath(@"Output/Output.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>
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
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);
//Retrieves the first slide from Presentation.
Expand All @@ -14,5 +14,5 @@
IEffect pathEffect = sequence[0] as IEffect;
//Increase the duration of the animation effect.
pathEffect.Behaviors[0].Timing.Duration = 5;
using FileStream outputStream = new(Path.GetFullPath(@"../../../Result.pptx"), FileMode.Create, FileAccess.ReadWrite);
using FileStream outputStream = new(Path.GetFullPath(@"Output/Output.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>
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
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);
//Retrieve the first slide from Presentation.
Expand All @@ -16,5 +16,5 @@
IEffect animationEffect = animationEffects[0];
//Change the animation effect type from swivel to GrowAndTurn.
animationEffect.Type = EffectType.GrowAndTurn;
using FileStream outputStream = new(Path.GetFullPath(@"../../../Result.pptx"), FileMode.Create, FileAccess.ReadWrite);
using FileStream outputStream = new(Path.GetFullPath(@"Output/Output.pptx"), FileMode.Create, FileAccess.ReadWrite);
pptxDoc.Save(outputStream);
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
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);
//Iterate the slide.
Expand All @@ -18,5 +18,5 @@
{
sequence.Remove(effect);
}
using FileStream outputStream = new(Path.GetFullPath(@"../../../Result.pptx"), FileMode.Create, FileAccess.ReadWrite);
using FileStream outputStream = new(Path.GetFullPath(@"Output/Output.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>
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
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);
//Iterate the slide.
Expand All @@ -18,5 +18,5 @@
sequence.Remove(effect);
//Insert the removed animation effect as first.
sequence.Insert(0, effect);
using FileStream outputStream = new(Path.GetFullPath(@"../../../Result.pptx"), FileMode.Create, FileAccess.ReadWrite);
using FileStream outputStream = new(Path.GetFullPath(@"Output/Output.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>
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>
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
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);
//Gets the first slide
Expand All @@ -23,5 +23,5 @@
chart.RightAngleAxes = true;
//Set the auto scaling of chart
chart.AutoScaling = true;
using FileStream outputStream = new(Path.GetFullPath(@"../../../Result.pptx"), FileMode.Create, FileAccess.ReadWrite);
using FileStream outputStream = new(Path.GetFullPath(@"Output/Output.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 @@ -15,7 +15,7 @@ static void Main(string[] args)
//Add pie chart
CreatePieChart(slide);
//Save the output PowerPoint Presentation
using FileStream outputStream = new(Path.GetFullPath("Output.pptx"), FileMode.Create, FileAccess.ReadWrite);
using FileStream outputStream = new(Path.GetFullPath("Output/Output.pptx"), FileMode.Create, FileAccess.ReadWrite);
pptxDoc.Save(outputStream);
}
/// <summary>
Expand Down
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 @@ -16,7 +16,7 @@ static void Main(string[] args)
//Add pie chart
CreatePieChart(slide);
//Save the output PowerPoint Presentation
using FileStream outputStream = new(Path.GetFullPath("Output.pptx"), FileMode.Create, FileAccess.ReadWrite);
using FileStream outputStream = new(Path.GetFullPath("Output/Output.pptx"), FileMode.Create, FileAccess.ReadWrite);
pptxDoc.Save(outputStream);
}
/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,16 @@
<PackageReference Include="Syncfusion.PresentationRenderer.Net.Core" Version="*" />
</ItemGroup>

<ItemGroup>
<None Update="Data\ChartToImage.jpg">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="Data\Sample.pptx">
<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 @@ -9,14 +9,14 @@ internal class Program
static void Main(string[] args)
{
//Loads or open an PowerPoint Presentation
FileStream inputStream = new FileStream("../../../Data/Sample.pptx", FileMode.Open);
FileStream inputStream = new FileStream(Path.GetFullPath(@"Data/Sample.pptx"), FileMode.Open);
IPresentation pptxDoc = Presentation.Open(inputStream);
//Initialize the PresentationRenderer
pptxDoc.PresentationRenderer = new PresentationRenderer();
//Gets the first instance of chart from slide
IPresentationChart chart = pptxDoc.Slides[0].Charts[0];
// Converts the chart to image.
Stream image = new FileStream("../../../Data/ChartToImage.jpg", FileMode.Create, FileAccess.ReadWrite);
Stream image = new FileStream(Path.GetFullPath(@"Output/Output.jpg"), FileMode.Create, FileAccess.ReadWrite);
pptxDoc.PresentationRenderer.ConvertToImage(chart, image);
//Closes the presentation
pptxDoc.Close();
Expand Down
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 @@ -37,7 +37,7 @@
seriesC.SerieFormat.ShowMeanLine = false;
seriesC.SerieFormat.QuartileCalculationType = QuartileCalculation.ExclusiveMedian;

using FileStream outputStream = new(Path.GetFullPath(@"../../../Result.pptx"), FileMode.Create, FileAccess.ReadWrite);
using FileStream outputStream = new(Path.GetFullPath(@"Output/Output.pptx"), FileMode.Create, FileAccess.ReadWrite);
pptxDoc.Save(outputStream);

/// <summary>
Expand Down
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>
Loading
Loading