Many organizations use PowerPoint presentations in meetings or other group discussion scenarios. There might be situations where you need to share the same information with other people. In such cases, you may either choose PPTX or PDF format. If the file is to be used for presentations only, then the PPTX file format is acceptable. But if the file is to be shared for information purposes, then the PDF format is a better and user-friendly option. In this article, you will learn how to convert PowerPoint slides to PDF format using C++.
- C++ API for PowerPoint to PDF conversion
- PowerPoint to PDF conversion using C++
- Convert PowerPoint to PDF with additional options
- Get a Free License
TIP: The PowerPoint to PDF conversion process powered by Aspose.Slides has been implemented in Aspose’s free online PowerPoint to PDF Converter.
C++ API for PowerPoint to PDF conversion
Aspose.Slides for C++ is a C++ library for creating and reading PowerPoint documents without using Microsoft PowerPoint. In addition, it also supports converting PowerPoint files to PDF format. You can either install the API through NuGet or download it directly from the Downloads section.
PM> Install-Package Aspose.Slides.Cpp
Convert PowerPoint to PDF using C++
The following are the steps to convert PowerPoint presentations to PDF format.
- Load the PowerPoint file using the Presentation class.
- Use the Presentation->Save (System::String name, Export::SaveFormat format) method to save the presentation as a PDF file.
The following is the sample code to convert PowerPoint presentations to PDF using C++.
Convert PowerPoint to PDF with additional options
Aspose.Slides for C++ provides the PdfOptions class to customize the conversion of PowerPoint presentations to PDF format. The following are some of the options provided by the PdfOptions class.
- Password: Set the password to protect the PDF file.
- AccessPermissions: Set the PDF permissions using the PdfAccessPermissions enum.
- TextCompression: Set the text compression to be used using the PdfTextCompression enum.
- ShowHiddenSlides: Specify whether to include hidden slides in the converted PDF file.
- JpegQuality: Set the value to determine the quality of JPEG images in the PDF file.
- Compliance: Set the compliance level of the generated PDF file using the PdfCompliance enum.
- EmbedFullFonts: Set whether to include full fonts or only the used subset in the generated PDF file.
The following are the steps to convert PowerPoint presentations to PDF format with additional options.
- Load the PowerPoint presentation file using the Presentation class.
- Create an instance of the PdfOptions class.
- Set the desired options such as ShowHiddenSlides.
- Save the PowerPoint as PDF using the Presentation->Save (System::String name, Export::SaveFormat format, System::SharedPtr<Export::ISaveOptions> options) method.
The following is the sample code to convert PowerPoint to PDF with additional options.
Get a Free License
You can try the API without evaluation limitations by requesting a free temporary license.
Conclusion
In this article, you have learned how to convert PowerPoint presentations to PDF format programmatically using C++. In addition, you have learned how to customize the conversion of PowerPoint to PDF files using Aspose.Slides for C++ API. The API provides many additional features that you can explore in detail by using the official documentation. If you have any questions, please feel free to contact us on the forum.