Are you a C++ developer looking to add to integrate MD to PPSM conversion feature inside your C++ applications? You can do it in two simple steps. You can export MD to PPTX by using Aspose.PDF for C++ . Secondly, by using Aspose.Slides for C++ , you can convert PPTX to PPSM. Both APIs come under Aspose.Total for C++ package.
C++ API to Export MD to PPSM
- Open MD file using Document class reference
- Convert MD to PPTX by using Save method function
- Load PPTX document by using Presentation class reference
- Save the document to PPSM format using
Save
member function and set
Ppsm
as SaveFormat
Get Started with C++ File Automation APIs
Install from command line as nuget install Aspose.Total.Cpp
or via Package Manager Console of Visual Studio with Install-Package Aspose.Total.Cpp
.
Alternatively, get the offline MSI installer or DLLs in a ZIP file from downloads .
// load MD file with an instance of Document class
auto doc = MakeObject<Document>(u"template.md");
// save MD as PPTX format
doc->Save(u"PptxOutput.pptx", SaveFormat::Pptx);
// instantiate a Presentation object that represents a PPTX file
SharedPtr<Presentation> prs = MakeObject<Presentation>(u"PptxOutput.pptx");
// save the presentation as Ppsm format
prs->Save(u"output.ppsm", Aspose::Slides::Export::SaveFormat::Ppsm);
Change Password of MD Document via C++
In the process of rendering MD to PPSM, you can open a password protected MD and also change its password. In order to change the password of a MD file, you must know the owner password of that document. You can load password protected PDF document with Aspose.PDF for C++ by specifying its owner password and use ChangePasswords method to change the password.
// load an existing MD Document
auto doc = MakeObject<Document>(L"input.md", L"owner");
// change password of MD Document
doc->ChangePasswords(L"owner", L"newuser", L"newuser");
// save the document
doc->Save(L"output.Doc");
Add Images From Web in PPSM File via C++
After converting MD to PPSM, you can also add images from web to your output document. Aspose.Slides for C++ supports operations with images in these popular formats: JPEG, PNG, BMP, GIF, and others. You can add one or several images on your computer onto a slide in a presentation. This sample code in C++ shows you how to add an image to a PPSM file
// instantiate a Presentation object that represents a PPSM file
auto pres = System::MakeObject<Presentation>("output.ppsm");
// get slide
auto slide = pres->get_Slides()->idx_get(0);
// initialize Web Client
auto webClient = System::MakeObject<WebClient>();
// get image data
auto imageData = webClient->DownloadData(System::MakeObject<Uri>(u"[REPLACE WITH URL]"));
// add image
auto image = pres->get_Images()->AddImage(imageData);
// add picture frame
slide->get_Shapes()->AddPictureFrame(ShapeType::Rectangle, 10.0f, 10.0f, 100.0f, 100.0f, image);
// save updated file
pres->Save(u"updated.ppsm", SaveFormat::Ppsm);
Explore MD Conversion Options with C++
What is MD File Format?
MD, or Markdown, is a lightweight markup language commonly used for formatting plain text documents. It was created by John Gruber in 2004 with the goal of allowing writers to focus on content without the distractions of complex formatting. Markdown uses simple and intuitive syntax that can be easily converted into HTML or other document formats.
In Markdown, you can apply formatting to text by using a combination of special characters and plain text. For example, you can use asterisks or underscores to create italic or bold text, hashtags to create headings, and hyphens or asterisks to create lists. Markdown also supports adding links, images, code snippets, and tables.
One of the advantages of Markdown is its readability in its raw form, as it closely resembles plain text. It can be written in any text editor and easily converted into HTML or other formats using various tools and converters. Markdown files have the .md or .markdown file extension.
Markdown is widely used for writing documentation, creating blog posts, and even in version control systems like Git. Its simplicity and versatility have made it a popular choice among writers, developers, and content creators for creating structured and well-formatted documents with minimal effort.
What is PPSM File Format?
The PPSM file format is an extension used by Microsoft PowerPoint to save presentations with embedded macros. It is an evolution of the PPSX file format, which is commonly used for PowerPoint slideshow presentations. The “M” in PPSM stands for “macro-enabled”, indicating that the file supports the execution of macros within the presentation.
PPSM files allow for interactive and dynamic content in PowerPoint presentations through the use of macros, which are sets of instructions or commands that automate tasks or add functionality. Macros can be created using Visual Basic for Applications (VBA) and provide advanced capabilities such as interactive buttons, automated actions, and custom functions.
When a PPSM file is opened, PowerPoint enables the execution of macros, allowing the presentation to respond to user interactions or perform predefined actions. This enables the creation of interactive slideshows and enhances the overall user experience.
The PPSM format is particularly useful for creating self-running presentations, kiosk displays, or interactive training modules. By incorporating macros, presenters can automate processes, trigger specific actions, or customize the behavior of the presentation based on user input.
It’s important to note that due to the potential security risks associated with macros, some organizations may have security settings in place that restrict the execution of macros in PowerPoint files. Therefore, when sharing PPSM files, it’s essential to ensure that recipients are aware of the macro functionality and have appropriate security settings enabled.