Convert JPG to PDF in C++
Convert JPG files to PDF documents using Aspose.Slides for C++ without Microsoft PowerPoint.
Convert JPG to PDF in C++
Aspose.Slides for C++ is a presentation processing API that can import JPG files into slides and save the result as a PDF document.
Aspose.Slides for C++ can convert JPG content to PDF documents and other presentation-related formats.
Convert JPG to PDF Using C++
To convert JPG to PDF, create a Presentation from the JPG file and save it as a PDF document.
C++ code for converting JPG into PDF
auto presentation = MakeObject<Presentation>();
auto slide = presentation->get_Slide(0);
auto imageData = File::ReadAllBytes(u"image.jpg");
auto presentationImage = presentation->get_Images()->AddImage(imageData);
slide->get_Shapes()->AddPictureFrame(ShapeType::Rectangle, 10, 10, 100, 100, presentationImage);
presentation->Save(u"presentation.pdf", SaveFormat::Pdf);
presentation->Dispose();
How to Convert JPG to PDF Using Aspose.Slides for C++ API
These are the steps to convert JPG to PDF in C++.
Install Aspose.Slides for C++ .
Add a library reference (import the library) to your C++ project.
Open the source JPG file in C++.
Save the result as a PDF file.
Free Online Converter
Convert presentations and slides online.
Convert JPG to Other Supported Formats
You can also convert JPG files and save them to other file formats. See all supported formats below.