Convert Image to PDF in C#

In certain cases, you may need to convert PNG, JPG, or other image files to a PDF document. This could be useful in scenarios such as converting scanned pages of invoices to PDF. In this article, you will learn how to convert an image to PDF format in C#. We will also demonstrate the conversion of multiple images to a PDF programmatically.

C# Image to PDF Converter API - Free Download

For image to PDF conversion, we’ll use Aspose.PDF for .NET. It is a powerful PDF API that lets you create and manipulate PDF files from within your .NET applications. Also, it provides high-fidelity back-and-forth conversion of PDF files. You can either download the API or install it using NuGet.

PM> Install-Package Aspose.Pdf

Convert an Image to PDF in C#

Let’s first have a look at how to convert a single image to a PDF file in C#. The following are the steps to perform this operation.

The following code sample shows how to convert a PNG image to PDF in C#.

Convert Multiple Images to a PDF in C#

The following are the steps to convert multiple images to a single PDF file in C#.

The following code sample shows the conversion of multiple images to a single PDF in C#.

Image to PDF C# Converter - Get a Free License

You can convert images to PDF without evaluation limitations by getting a free temporary license.

C# .NET PDF API - Read More

You can explore more about Aspose.PDF for .NET using documentation. In case you would have any queries, feel free to let us know via our forum.

Conclusion

In this article, you have learned how to convert an image to PDF format in C#. Also, you have seen how to convert multiple images to a single PDF programmatically. Thus, you can easily perform any kind of image to PDF conversion in your application.

See Also