Skip to content

Commit 8d609dd

Browse files
Updated examples to version 25.5
1 parent 24ceea3 commit 8d609dd

12 files changed

+161
-6
lines changed
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#include "stdafx.h"
2+
#include "SlidesExamples.h"
3+
4+
using namespace Aspose::Slides;
5+
using namespace Export;
6+
using namespace System;
7+
using namespace IO;
8+
9+
void ConvertToHtml5Handout()
10+
{
11+
// Path to files
12+
const String presFilePath = Path::Combine(GetDataPath(), u"HandoutExample.pptx");
13+
const String outFilePath = Path::Combine(GetOutPath(), u"HandoutExample.html");
14+
15+
SharedPtr<Presentation> pres = MakeObject<Presentation>(presFilePath);
16+
SharedPtr<HandoutLayoutingOptions> slidesLayoutOptions = MakeObject<HandoutLayoutingOptions>();
17+
slidesLayoutOptions->set_Handout(HandoutType::Handouts4Horizontal);
18+
SharedPtr<Html5Options> options = MakeObject<Html5Options>();
19+
options->set_SlidesLayoutOptions(slidesLayoutOptions);
20+
21+
// Save result
22+
pres->Save(outFilePath, SaveFormat::Html5, options);
23+
}
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
#include "stdafx.h"
2+
#include "SlidesExamples.h"
3+
4+
using namespace Aspose::Slides;
5+
using namespace Export;
6+
using namespace System;
7+
using namespace IO;
8+
9+
void ConvertToMarkdownOptions()
10+
{
11+
// Paths
12+
const String presentationPath = Path::Combine(GetDataPath(), u"PresentationDemo.pptx");
13+
const String mdOutPath = Path::Combine(GetOutPath(), u"pres-out.md");
14+
15+
SharedPtr<Presentation> pres = System::MakeObject<Presentation>(presentationPath);
16+
17+
SharedPtr<MarkdownSaveOptions> options = MakeObject<MarkdownSaveOptions>();
18+
options->set_RemoveEmptyLines(true);
19+
options->set_HandleRepeatedSpaces(HandleRepeatedSpaces::AlternateSpacesToNbsp);
20+
options->set_SlideNumberFormat(u"## Slide {0} -");
21+
options->set_ShowSlideNumber(true);
22+
options->set_ExportType(MarkdownExportType::TextOnly);
23+
options->set_Flavor(Flavor::Default);
24+
25+
// Save presentation in Markdown format
26+
pres->Save(mdOutPath, SaveFormat::Md, options);
27+
}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#include "stdafx.h"
2+
#include "SlidesExamples.h"
3+
4+
using namespace Aspose::Slides;
5+
using namespace Export;
6+
using namespace System;
7+
using namespace IO;
8+
9+
void ImportHtmlSlideExample()
10+
{
11+
const String htmlFileName = Path::Combine(GetDataPath(), u"TestHtml.html");
12+
const String outPresName = Path::Combine(GetOutPath(), u"OutputConvertedHtml.pptx");
13+
14+
SharedPtr<Presentation> pres = MakeObject<Presentation>();
15+
SharedPtr<Stream> inputStream = MakeObject<FileStream>(htmlFileName, FileMode::Open);
16+
pres->get_Slides()->InsertFromHtml(0, inputStream, true);
17+
18+
// Save the presentation
19+
pres->Save(outPresName, SaveFormat::Pptx);
20+
}
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
#include "stdafx.h"
2+
#include "SlidesExamples.h"
3+
4+
using namespace Aspose::Slides;
5+
using namespace Export;
6+
using namespace System;
7+
using namespace IO;
8+
9+
void PictureFrameIsCameoExample()
10+
{
11+
// Path to source presentation
12+
const String presentationName = Path::Combine(GetDataPath(), u"PresCameo.pptx");
13+
14+
SharedPtr<Presentation> pres = MakeObject<Presentation>(presentationName);
15+
// Check if first picture frame is Cameo
16+
SharedPtr<PictureFrame> shape = AsCast<PictureFrame>(pres->get_Slide(0)->get_Shape(0));
17+
if (shape != nullptr)
18+
{
19+
Console::WriteLine(u"First picture is Cameo: {0}", shape->get_IsCameo());
20+
}
21+
22+
// Check if third picture frame is Cameo
23+
shape = AsCast<PictureFrame>(pres->get_Slide(0)->get_Shape(2));
24+
if (shape != nullptr)
25+
{
26+
Console::WriteLine(u"Third picture is Cameo: {0}", shape->get_IsCameo());
27+
}
28+
}

Examples/SlidesCPP/SlidesCPP.vcxproj

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -278,8 +278,10 @@
278278
<ClCompile Include="ConvertToGif.cpp" />
279279
<ClCompile Include="ConvertToHandout.cpp" />
280280
<ClCompile Include="ConvertToHtml5.cpp" />
281+
<ClCompile Include="ConvertToHtml5Handout.cpp" />
281282
<ClCompile Include="ConvertToHtml5NotesComments.cpp" />
282283
<ClCompile Include="ConvertToMarkdown.cpp" />
284+
<ClCompile Include="ConvertToMarkdownOptions.cpp" />
283285
<ClCompile Include="ConvertToPDF.cpp" />
284286
<ClCompile Include="ConvertToPdfConformancePdf1A_PdfUa.cpp" />
285287
<ClCompile Include="ConvertToPdfUnsupportedFontStyles.cpp" />
@@ -403,6 +405,7 @@
403405
<ClCompile Include="HighlightText.cpp" />
404406
<ClCompile Include="HighlightTextUsingRegx.cpp" />
405407
<ClCompile Include="ImageQualityExample.cpp" />
408+
<ClCompile Include="ImportHtmlSlideExample.cpp" />
406409
<ClCompile Include="ImportingHTMLText.cpp" />
407410
<ClCompile Include="InkManagementExample.cpp" />
408411
<ClCompile Include="InsertSvgIntoPresentation.cpp" />
@@ -454,6 +457,7 @@
454457
<ClCompile Include="ImportFromPdf.cpp" />
455458
<ClCompile Include="PdfImportTableExample.cpp" />
456459
<ClCompile Include="PictureFrameFormatting.cpp" />
460+
<ClCompile Include="PictureFrameIsCameoExample.cpp" />
457461
<ClCompile Include="PictureOrganizationChart.cpp" />
458462
<ClCompile Include="PieChart.cpp" />
459463
<ClCompile Include="PortionGetRect.cpp" />
@@ -618,8 +622,8 @@
618622
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
619623
<ImportGroup Label="ExtensionTargets">
620624
<Import Project="..\packages\Aspose.Cells.Cpp.23.11.0\build\native\Aspose.Cells.Cpp.targets" Condition="Exists('..\packages\Aspose.Cells.Cpp.23.11.0\build\native\Aspose.Cells.Cpp.targets')" />
621-
<Import Project="..\packages\Aspose.Slides.Cpp.x86.25.4.0\build\native\Aspose.Slides.Cpp.x86.targets" Condition="Exists('..\packages\Aspose.Slides.Cpp.x86.25.4.0\build\native\Aspose.Slides.Cpp.x86.targets')" />
622-
<Import Project="..\packages\Aspose.Slides.Cpp.25.4.0\build\native\Aspose.Slides.Cpp.targets" Condition="Exists('..\packages\Aspose.Slides.Cpp.25.4.0\build\native\Aspose.Slides.Cpp.targets')" />
623-
<Import Project="..\packages\CodePorting.Translator.Cs2Cpp.Framework.25.4.0\build\native\CodePorting.Translator.Cs2Cpp.Framework.targets" Condition="Exists('..\packages\CodePorting.Translator.Cs2Cpp.Framework.25.4.0\build\native\CodePorting.Translator.Cs2Cpp.Framework.targets')" />
625+
<Import Project="..\packages\Aspose.Slides.Cpp.x86.25.5.0\build\native\Aspose.Slides.Cpp.x86.targets" Condition="Exists('..\packages\Aspose.Slides.Cpp.x86.25.5.0\build\native\Aspose.Slides.Cpp.x86.targets')" />
626+
<Import Project="..\packages\Aspose.Slides.Cpp.25.5.0\build\native\Aspose.Slides.Cpp.targets" Condition="Exists('..\packages\Aspose.Slides.Cpp.25.5.0\build\native\Aspose.Slides.Cpp.targets')" />
627+
<Import Project="..\packages\CodePorting.Translator.Cs2Cpp.Framework.25.5.0\build\native\CodePorting.Translator.Cs2Cpp.Framework.targets" Condition="Exists('..\packages\CodePorting.Translator.Cs2Cpp.Framework.25.5.0\build\native\CodePorting.Translator.Cs2Cpp.Framework.targets')" />
624628
</ImportGroup>
625629
</Project>

Examples/SlidesCPP/SlidesCPP.vcxproj.filters

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1425,6 +1425,18 @@
14251425
<ClCompile Include="AdjustValueTypeExample.cpp">
14261426
<Filter>Source Files\Slides\Shapes</Filter>
14271427
</ClCompile>
1428+
<ClCompile Include="ConvertToHtml5Handout.cpp">
1429+
<Filter>Source Files\Presentations\Conversions</Filter>
1430+
</ClCompile>
1431+
<ClCompile Include="ConvertToMarkdownOptions.cpp">
1432+
<Filter>Source Files\Presentations\Conversions</Filter>
1433+
</ClCompile>
1434+
<ClCompile Include="ImportHtmlSlideExample.cpp">
1435+
<Filter>Source Files\Presentations\Conversions</Filter>
1436+
</ClCompile>
1437+
<ClCompile Include="PictureFrameIsCameoExample.cpp">
1438+
<Filter>Source Files\Slides\Shapes</Filter>
1439+
</ClCompile>
14281440
</ItemGroup>
14291441
<ItemGroup>
14301442
<ClInclude Include="SlidesExamples.h">

Examples/SlidesCPP/SlidesExamples.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,9 @@ void ConvertToXml();
7979
void ExportOleExample();
8080
void ConvertToEmf();
8181
void ConvertSvgToEmf();
82+
void ConvertToHtml5Handout();
83+
void ConvertToMarkdownOptions();
84+
void ImportHtmlSlideExample();
8285

8386
#pragma endregion
8487

@@ -299,6 +302,7 @@ void TilePictureFillFormatExample();
299302
void AnimationFloatUpDown();
300303
void CompressImageExample();
301304
void AdjustValueTypeExample();
305+
void PictureFrameIsCameoExample();
302306
#pragma endregion
303307

304308
#pragma region Working with Charts

Examples/SlidesCPP/main.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,9 @@ int main(int argc, const char argv[])
9898
ExportOleExample();
9999
ConvertToEmf();
100100
ConvertSvgToEmf();
101+
ConvertToHtml5Handout();
102+
ConvertToMarkdownOptions();
103+
ImportHtmlSlideExample();
101104

102105
#pragma endregion
103106

@@ -494,6 +497,7 @@ int main(int argc, const char argv[])
494497
AnimationFloatUpDown();
495498
CompressImageExample();
496499
AdjustValueTypeExample();
500+
PictureFrameIsCameoExample();
497501

498502
#pragma endregion
499503

Examples/SlidesCPP/packages.config

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<packages>
33
<package id="Aspose.Cells.Cpp" version="23.11.0" targetFramework="native" />
4-
<package id="Aspose.Slides.Cpp" version="25.4.0" targetFramework="native" />
5-
<package id="Aspose.Slides.Cpp.x86" version="25.4.0" targetFramework="native" />
6-
<package id="CodePorting.Translator.Cs2Cpp.Framework" version="25.4.0" targetFramework="native" />
4+
<package id="Aspose.Slides.Cpp" version="25.5.0" targetFramework="native" />
5+
<package id="Aspose.Slides.Cpp.x86" version="25.5.0" targetFramework="native" />
6+
<package id="CodePorting.Translator.Cs2Cpp.Framework" version="25.5.0" targetFramework="native" />
77
</packages>

Examples/SlidesCPP/stdafx.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -442,6 +442,8 @@
442442
#include <Export/FramesStream/FrameTickEventArgs.h>
443443
#include <Export/Markdown/SaveOptions/MarkdownExportType.h>
444444
#include <Export/Markdown/SaveOptions/MarkdownSaveOptions.h>
445+
#include <Export/Markdown/SaveOptions/HandleRepeatedSpaces.h>
446+
#include <Export/Markdown/SaveOptions/Flavor.h>
445447
#include <Export/HandoutType.h>
446448
#include <Export/HandoutLayoutingOptions.h>
447449
#include <Export/IInkOptions.h>

0 commit comments

Comments
 (0)