# Convert PDF to Image in C++

> Convert PDF to images in C++. Use the C++ library API to import PDF files and render slides as images.

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



## Convert PDF to Image in C++

[**Aspose.Slides for C++**](/slides/cpp/) is a presentation processing API that can import PDF pages into slides and render those slides as images. Using **Aspose.Slides for C++**, developers can convert PDF files to images with just a few lines of C++ code.

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

## Convert PDF to Image Using C++

To convert PDF to images, create a `Presentation`, remove the default slide, import the PDF pages, and render each slide as an image.

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

```cpp
auto presentation = MakeObject<Presentation>();
presentation->get_Slides()->RemoveAt(0);
presentation->get_Slides()->AddFromPdf(u"input.pdf");

auto slideCount = presentation->get_Slides()->get_Count();
for (int slideIndex = 0; slideIndex < slideCount; slideIndex++)
{
    auto currentSlide = presentation->get_Slide(slideIndex);
    if (currentSlide->get_Hidden())
    {
        continue;
    }

    auto slideImage = currentSlide->GetImage(2.0f, 2.0f);
    auto outputFilePath = String(u"slide_") + slideIndex + u".png";
    slideImage->Save(outputFilePath, ImageFormat::Png);
    slideImage->Dispose();
}

presentation->Dispose();
```

## How to convert PDF to Image using Aspose.Slides for C++ API

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

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

Add a library reference to your C++ project.

Remove the default slide and import the source PDF file into the `Presentation` object.

Render each slide and save it as an image file.

## Convert PDF to Other Supported Formats

- [PDF TO HTML](/slides/cpp/conversion/pdf-to-html/)
- [PDF TO JPG](/slides/cpp/conversion/pdf-to-jpg/)
- [PDF TO PNG](/slides/cpp/conversion/pdf-to-png/)
- [PDF TO TIFF](/slides/cpp/conversion/pdf-to-tiff/)
- [PDF TO XML](/slides/cpp/conversion/pdf-to-xml/)
- [PDF TO SVG](/slides/cpp/conversion/pdf-to-svg/)
- [PDF TO PPTX](/slides/cpp/conversion/pdf-to-pptx/)
- [PDF TO PPT](/slides/cpp/conversion/pdf-to-ppt/)
