Created
September 4, 2020 21:01
-
-
Save aspose-com-gists/9421c9bffced10a94c4f9eb8b5e0a983 to your computer and use it in GitHub Desktop.
Convert PowerPoint Presentation PPTX PPT to Webpage HTML using C++
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
// The path to the documents directory. | |
const String outPath = u"../out/"; | |
const String templatePath = u"../templates/AccessSlides.pptx"; | |
//Instantiate Presentation class that represents PPTX file | |
SharedPtr<Presentation> pres = MakeObject<Presentation>(templatePath); | |
SharedPtr<HtmlOptions> htmlOptions = MakeObject<HtmlOptions>(); | |
htmlOptions->set_HtmlFormatter(HtmlFormatter::CreateCustomFormatter(System::MakeObject<CustomFormattingController>())); | |
// Saving each slide as separate HTML file | |
for (int i = 0; i < pres->get_Slides()->get_Count(); i++) | |
{ | |
pres->Save(outPath + u"Individual Slide" + (i + 1) + u"_out.html", System::MakeArray<int32_t>({ i + 1 }), SaveFormat::Html, htmlOptions); | |
} |
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
// The path to the documents directory. | |
const String outPath = u"../out/"; | |
const String templatePath = u"../templates/AccessSlides.pptx"; | |
//Instantiate Presentation class that represents PPTX file | |
SharedPtr<Presentation> pres = MakeObject<Presentation>(templatePath); | |
SharedPtr<HtmlOptions> htmlOptions = MakeObject<HtmlOptions>(); | |
htmlOptions->set_HtmlFormatter(HtmlFormatter::CreateCustomFormatter(System::MakeObject<CustomFormattingController>())); | |
// Saving second slide to HTML File | |
pres->Save(outPath + u"Individual Slide" + (2) + u"_out.html", System::MakeArray<int32_t>({ 2 }), SaveFormat::Html, htmlOptions); |
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
const String outPath = u"../out/ConvertWholePresentationToHTML_out.html"; | |
const String templatePath = u"../templates/AccessSlides.pptx"; | |
//Instantiate Presentation class that represents PPTX file | |
SharedPtr<Presentation> pres = MakeObject<Presentation>(templatePath); | |
SharedPtr<ResponsiveHtmlController> controller = MakeObject<ResponsiveHtmlController>(); | |
SharedPtr<HtmlOptions> htmlOptions = MakeObject <HtmlOptions>(); | |
htmlOptions->set_HtmlFormatter((HtmlFormatter::CreateSlideShowFormatter(u"", false))); | |
pres->Save(outPath, SaveFormat::Html, htmlOptions); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment