# Merge PNG to PDF in C#

> Merge PNG images to PDF in C#. Use the .NET library API to combine PNG files into a single PDF document.

Source: https://products.aspose.com/slides/net/merger/png-to-pdf/
Updated: 2026-07-09



## Merge PNG to PDF using Aspose.Slides

[**Aspose.Slides for .NET**](/slides/net/) lets you create, convert, merge, and manipulate presentations, PDFs, images, and other files. You can place PNG images on slides and save the result as a single PDF document.

## Merge PNG to PDF in C#

Using [**Aspose.Slides for .NET**](/slides/net/), you can add PNG images to a `Presentation` object and save the presentation with `SaveFormat.Pdf`.

### C# code for merging PNG to PDF

```cs
using var presentation = new Presentation();
presentation.Slides.RemoveAt(0);

var layoutSlide = presentation.LayoutSlides[0];

foreach (var imagePath in new[] { "image1.png", "image2.png" })
{
    var slide = presentation.Slides.AddEmptySlide(layoutSlide);

    var imageData = File.ReadAllBytes(imagePath);
    var presentationImage = presentation.Images.AddImage(imageData);
    slide.Shapes.AddPictureFrame(ShapeType.Rectangle, 0, 0, 720, 540, presentationImage);
}

presentation.Save("merged.pdf", SaveFormat.Pdf);
```

## How to merge PNG to PDF in C#

Install **Aspose.Slides for .NET**. See [**Installation**](https://docs.aspose.com/slides/net/installation/).

Add the library as a reference in your project.

Create a `Presentation` object.

Add each source PNG image to a slide as a picture frame.

Save the presentation with `SaveFormat.Pdf`.

## Merge other files
