# Convert Image to PDF in C++

> Convert image to PDF in C++. Use the C++ library API to convert image files to PDF documents.

Source: https://products.aspose.com/slides/cpp/conversion/image-to-pdf/
Updated: 2026-07-30



## Convert Image to PDF in C++

[**Aspose.Slides for C++**](/slides/cpp/) is a presentation processing API that can import images into slides and save the result as a PDF document.

Aspose.Slides for C++ can convert image content to PDF documents and other presentation-related formats.

## Convert Image to PDF Using C++

To convert an image to PDF, create a new Presentation, add the image to its image collection, place it on a slide with `AddPictureFrame`, and save the presentation as a PDF document.

### C++ code for converting Image into PDF

```cpp
auto presentation = MakeObject<Presentation>();
auto slide = presentation->get_Slide(0);

auto imageData = File::ReadAllBytes(u"image.png");
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 Image to PDF Using Aspose.Slides for C++ API

These are the steps to convert Image to PDF in C++.

Install [**Aspose.Slides for C++**](/slides/cpp/).

Add a library reference (import the library) to your C++ project.

Open the source image file in C++.

Save the result as a PDF file.

## Convert Image to Other Supported Formats

- [IMAGE TO JPG](/slides/cpp/conversion/image-to-jpg/)
- [IMAGE TO PPT](/slides/cpp/conversion/image-to-ppt/)
- [IMAGE TO PPTX](/slides/cpp/conversion/image-to-pptx/)
