IronPDF How-Tos Image to PDF How to Convert Images to a PDF Chaknith Bin Updated:July 28, 2025 Converting images to PDF is a useful process that combines multiple image files (such as JPG, PNG, or TIFF) into a single PDF document. This is often done to create digital portfolios, presentations, or reports, making it easier to share and store a collection of images in a more organized and universally readable format. IronPDF allows you to convert a single or multiple images into a PDF with unique image placements and behaviors. These behaviors include fitting to the page, centering on the page, and cropping the page. Additionally, you can add text and HTML headers and footers using IronPDF, apply watermarks with IronPDF, set custom page sizes, and include background and foreground overlays. Get started making PDFs with NuGet now: Install IronPDF with NuGet PM > Install-Package IronPdf Copy the code IronPdf.ImageToPdfConverter .ImageToPdf("path/to/image.png") .SaveAs("image.pdf"); Deploy to test on your live environment Start using IronPDF in your project today with a free trial Free 30 day Trial Get started with IronPDF Start using IronPDF in your project today with a free trial. First Step: Start for Free How to Convert Images to a PDF Download the IronPDF C# library for converting images to PDF Prepare the image or images you want to convert Supply the image path(s) to the ImageToPdf static method Adjust the image placement and behavior in the output PDF Add custom text and HTML header and footer using IronPDF Convert Image to PDF Example Use the ImageToPdf static method within the ImageToPdfConverter class to convert an image to a PDF document. This method requires only the file path to the image, and it will convert it to a PDF document with default image placement and behavior. Supported image formats include .bmp, .jpeg, .jpg, .gif, .png, .svg, .tif, .tiff, .webp, .apng, .avif, .cur, .dib, .ico, .jfif, .jif, .jpe, .pjp, and .pjpeg. Sample Image Code :path=/static-assets/pdf/content-code-examples/how-to/image-to-pdf-convert-one-image.cs using IronPdf; string imagePath = "meetOurTeam.jpg"; // Convert an image to a PDF PdfDocument pdf = ImageToPdfConverter.ImageToPdf(imagePath); // Export the PDF pdf.SaveAs("imageToPdf.pdf"); Imports IronPdf Private imagePath As String = "meetOurTeam.jpg" ' Convert an image to a PDF Private pdf As PdfDocument = ImageToPdfConverter.ImageToPdf(imagePath) ' Export the PDF pdf.SaveAs("imageToPdf.pdf") $vbLabelText $csharpLabel Output PDF Convert Images to PDF Example To convert multiple images into a PDF document, you should provide an IEnumerable object that contains file paths instead of a single file path, as shown in our previous example. This will once again generate a PDF document with default image placement and behavior. :path=/static-assets/pdf/content-code-examples/how-to/image-to-pdf-convert-multiple-images.cs using IronPdf; using System; using System.Collections.Generic; using System.IO; using System.Linq; // Retrieve all JPG and JPEG image paths in the 'images' folder. IEnumerable<String> imagePaths = Directory.EnumerateFiles("images").Where(f => f.EndsWith(".jpg") || f.EndsWith(".jpeg")); // Convert images to a PDF PdfDocument pdf = ImageToPdfConverter.ImageToPdf(imagePaths); // Export the PDF pdf.SaveAs("imagesToPdf.pdf"); Imports IronPdf Imports System Imports System.Collections.Generic Imports System.IO Imports System.Linq ' Retrieve all JPG and JPEG image paths in the 'images' folder. Private imagePaths As IEnumerable(Of String) = Directory.EnumerateFiles("images").Where(Function(f) f.EndsWith(".jpg") OrElse f.EndsWith(".jpeg")) ' Convert images to a PDF Private pdf As PdfDocument = ImageToPdfConverter.ImageToPdf(imagePaths) ' Export the PDF pdf.SaveAs("imagesToPdf.pdf") $vbLabelText $csharpLabel Output PDF Image Placements and Behaviors For ease of use, we offer a range of helpful image placement and behavior options. For instance, you can center the image on the page or fit it to the page size while maintaining its aspect ratio. All available image placements and behaviors are as follows: TopLeftCornerOfPage: Image is placed at the top-left corner of the page. TopRightCornerOfPage: Image is placed at the top-right corner of the page. CenteredOnPage: Image is centered on the page. FitToPageAndMaintainAspectRatio: Image fits the page while keeping its original aspect ratio. BottomLeftCornerOfPage: Image is placed at the bottom-left corner of the page. BottomRightCornerOfPage: Image is placed at the bottom-right corner of the page. FitToPage: Image fits the page. CropPage: Page is adjusted to fit the image. :path=/static-assets/pdf/content-code-examples/how-to/image-to-pdf-convert-one-image-image-behavior.cs using IronPdf; using IronPdf.Imaging; string imagePath = "meetOurTeam.jpg"; // Convert an image to a PDF with image behavior of centered on page PdfDocument pdf = ImageToPdfConverter.ImageToPdf(imagePath, ImageBehavior.CenteredOnPage); // Export the PDF pdf.SaveAs("imageToPdf.pdf"); Imports IronPdf Imports IronPdf.Imaging Private imagePath As String = "meetOurTeam.jpg" ' Convert an image to a PDF with image behavior of centered on page Private pdf As PdfDocument = ImageToPdfConverter.ImageToPdf(imagePath, ImageBehavior.CenteredOnPage) ' Export the PDF pdf.SaveAs("imageToPdf.pdf") $vbLabelText $csharpLabel Image Behaviors Comparison TopLeftCornerOfPage TopRightCornerOfPage CenteredOnPage FitToPageAndMaintainAspectRatio BottomLeftCornerOfPage BottomRightCornerOfPage FitToPage CropPage Apply Rendering Options The key to converting various types of images into a PDF document under the hood of the ImageToPdf static method is to import the image as an HTML <img> tag and then convert the HTML to PDF. This is also the reason we can pass the ChromePdfRenderOptions object as a third parameter of the ImageToPdf method to customize the rendering process directly. :path=/static-assets/pdf/content-code-examples/how-to/image-to-pdf-convert-one-image-rendering-options.cs using IronPdf; string imagePath = "meetOurTeam.jpg"; ChromePdfRenderOptions options = new ChromePdfRenderOptions() { HtmlHeader = new HtmlHeaderFooter() { HtmlFragment = "<h1 style='color: #2a95d5;'>Content Header</h1>", DrawDividerLine = true, }, }; // Convert an image to a PDF with custom header PdfDocument pdf = ImageToPdfConverter.ImageToPdf(imagePath, options: options); // Export the PDF pdf.SaveAs("imageToPdfWithHeader.pdf"); Imports IronPdf Private imagePath As String = "meetOurTeam.jpg" Private options As New ChromePdfRenderOptions() With { .HtmlHeader = New HtmlHeaderFooter() With { .HtmlFragment = "<h1 style='color: #2a95d5;'>Content Header</h1>", .DrawDividerLine = True } } ' Convert an image to a PDF with custom header Private pdf As PdfDocument = ImageToPdfConverter.ImageToPdf(imagePath, options:= options) ' Export the PDF pdf.SaveAs("imageToPdfWithHeader.pdf") $vbLabelText $csharpLabel Output PDF If you'd like to convert or rasterize a PDF document into images, please refer to our guide on how to rasterize PDFs to images. Ready to see what else you can do? Check out our tutorial page here: Convert PDFs Frequently Asked Questions How to convert images to PDF in .NET C#? You can convert images to PDF in .NET C# by using the IronPDF library's ImageToPdfConverter class. This class provides a straightforward method to convert image files into a PDF document by specifying the image path. What image formats can be converted to PDF using .NET C#? With IronPDF, you can convert a variety of image formats to PDF, including BMP, JPEG, GIF, PNG, SVG, TIFF, WEBP, and more. This flexibility ensures compatibility with most image files. How can I convert multiple images into a single PDF document in C#? To convert multiple images into a single PDF document using IronPDF, you can provide an IEnumerable object containing the file paths of the images. This allows you to compile all images into one cohesive PDF file. What options are available for placing images in a PDF? IronPDF provides several placement options for images in a PDF, such as TopLeftCornerOfPage, CenteredOnPage, FitToPageAndMaintainAspectRatio, and others. These options allow you to customize how the image appears on the PDF page. Can I add headers and footers to a PDF when converting images? Yes, you can add custom text and HTML headers and footers to a PDF when converting images using IronPDF. This feature is useful for adding additional information or branding to your PDF documents. Is it possible to include watermarks in a PDF during image conversion? Yes, IronPDF allows you to apply watermarks to PDFs during the conversion process. This can be done by following the guidelines in IronPDF's tutorials for adding watermarks. How can I customize the image to PDF conversion process? You can customize the image to PDF conversion process in IronPDF by using the ChromePdfRenderOptions object. This allows you to adjust rendering settings to suit your specific needs. What is the method IronPDF uses to convert images to PDFs? IronPDF converts images to PDFs by importing the image as an HTML <img> tag and then rendering it into a PDF format. This approach provides flexibility in the customization of the output file. Where can I find more resources on converting images to PDF using IronPDF? Additional resources and tutorials on converting images to PDF using IronPDF can be found on the official IronPDF website and within their comprehensive documentation. How does converting images to PDF benefit digital projects? Converting images to PDF benefits digital projects by organizing multiple images into a single, shareable document. This is ideal for creating digital portfolios, presentations, or reports that need to be distributed in a universally readable format. Chaknith Bin Chat with engineering team now Software Engineer Chaknith works on IronXL and IronBarcode. He has deep expertise in C# and .NET, helping improve the software and support customers. His insights from user interactions contribute to better products, documentation, and overall experience. Reviewed by Jeffrey T. Fritz Principal Program Manager - .NET Community Team Jeff is also a Principal Program Manager for the .NET and Visual Studio teams. He is the executive producer of the .NET Conf virtual conference series and hosts 'Fritz and Friends' a live stream for developers that airs twice weekly where he talks tech and writes code together with viewers. Jeff writes workshops, presentations, and plans content for the largest Microsoft developer events including Microsoft Build, Microsoft Ignite, .NET Conf, and the Microsoft MVP Summit Ready to Get Started? Free NuGet Download Total downloads: 14,968,429 View Licenses