Images To PDF
PDF documents can be easily constructed from one or more image files using the IronPdf.ImageToPdfConverter Class.
You can download a file project from this link.
// PM> Install-Package IronPdf using IronPdf; using System.IO; using System.Linq; // One or more images as IEnumerable. This example selects all JPEG images in a specific 'assets' folder. var ImageFiles = System.IO.Directory.EnumerateFiles("assets").Where(f => f.EndsWith(".jpg") || f.EndsWith(".jpeg")); // Converts the images to a PDF and save it. ImageToPdfConverter.ImageToPdf(ImageFiles).SaveAs("composite.pdf"); // Also see PdfDocument.RasterizeToImageFiles() method to flatten a PDF to images or thumbnails
' PM> Install-Package IronPdf Imports IronPdf Imports System.IO Imports System.Linq ' One or more images as IEnumerable. This example selects all JPEG images in a specific 'assets' folder. Private ImageFiles = System.IO.Directory.EnumerateFiles("assets").Where(Function(f) f.EndsWith(".jpg") OrElse f.EndsWith(".jpeg")) ' Converts the images to a PDF and save it. ImageToPdfConverter.ImageToPdf(ImageFiles).SaveAs("composite.pdf") ' Also see PdfDocument.RasterizeToImageFiles() method to flatten a PDF to images or thumbnails
You can download a file project from this link.