Are you a C++ developer looking to add to integrate TEX to PPTM conversion feature inside your C++ applications? You can do it in two simple steps. You can export TEX to PPTX by using Aspose.PDF for C++ . Secondly, by using Aspose.Slides for C++ , you can convert PPTX to PPTM. Both APIs come under Aspose.Total for C++ package.
C++ API to Export TEX to PPTM
- Open TEX file using Document class reference
- Convert TEX to PPTX by using Save method function
- Load PPTX document by using Presentation class reference
- Save the document to PPTM format using
member function and set
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
Alternatively, get the offline MSI installer or DLLs in a ZIP file from downloads .
// load TEX file with an instance of Document class auto doc = MakeObject<Document>(u"template.tex"); // save TEX 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 Pptm format prs->Save(u"output.pptm", Aspose::Slides::Export::SaveFormat::Pptm);
Change Password of TEX Document via C++
In the process of rendering TEX to PPTM, you can open a password protected TEX and also change its password. In order to change the password of a TEX 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 TEX Document auto doc = MakeObject<Document>(L"input.tex", L"owner"); // change password of TEX Document doc->ChangePasswords(L"owner", L"newuser", L"newuser"); // save the document doc->Save(L"output.Doc");
Add Images From Web in PPTM File via C++
After converting TEX to PPTM, 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 PPTM file
// instantiate a Presentation object that represents a PPTM file auto pres = System::MakeObject<Presentation>("output.pptm"); // 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.pptm", SaveFormat::Pptm);
Explore TEX Conversion Options with C++
What is TEX File Format?
The TeX file format is a typesetting system developed by Donald Knuth in the late 1970s. It is widely used in academia, particularly in the fields of mathematics, physics, and computer science, for creating professional-looking documents with complex mathematical formulas and symbols. TeX files are plain text files that contain a mixture of text and formatting commands.
TeX provides a powerful and flexible way to produce high-quality documents. It allows precise control over the layout and formatting of the document, including fonts, spacing, line breaks, page breaks, and mathematical equations. TeX uses a macro language that enables users to define their own commands and create custom styles and templates.
TeX files are typically processed by a TeX engine, such as pdfTeX or XeTeX, which reads the input file, interprets the formatting commands, and generates a typeset document in a variety of output formats, such as PDF, DVI, or PostScript. The typesetting process involves multiple passes, where the engine analyzes the document, resolves cross-references, and adjusts the layout to ensure optimal spacing and line breaks.
TeX is known for its exceptional typesetting quality and its ability to handle complex mathematical notation. It is widely used in academic publications, research papers, books, and technical documentation. The TeX format supports various extensions, such as LaTeX, which provides higher-level commands and document classes for easier document authoring.
What is PPTM File Format?
The PPTM file format is a file extension used by Microsoft PowerPoint to save presentations that contain macros. It is an extension of the PPTX file format, which is the default file format for PowerPoint presentations. The “M” in PPTM stands for “macro-enabled” indicating that the file can contain embedded macros written in the Visual Basic for Applications (VBA) programming language.
PPTM files are created and edited using Microsoft PowerPoint or other compatible software that supports the PowerPoint file format. These files can include various multimedia elements such as text, images, videos, audio, and animations. Additionally, PPTM files can incorporate interactive features and custom functionalities through the use of macros.
Macros in PPTM files allow users to automate repetitive tasks, create interactive content, and add custom functionality to their presentations. Macros can be written using the VBA programming language and can perform a wide range of operations, including data manipulation, user input handling, and integration with other software applications.
When opening a PPTM file, PowerPoint may prompt the user to enable or disable macros for security reasons, as macros can potentially execute malicious code. It is important to exercise caution when opening PPTM files from unknown or untrusted sources.