Images To PDF

C# + VB.Net: Images To PDF Images To PDF
using IronPdf;
using System.IO;
using System.Linq;

// Select one or more images.  This example selects all JPEG images in a specific folder.
var ImageFiles = Directory.EnumerateFiles(@"C:\project\assets").Where(f => f.EndsWith(".jpg") || f.EndsWith(".jpeg"));

// Convert the images to a PDF and save it.
ImageToPdfConverter.ImageToPdf(ImageFiles).SaveAs(@"C:\project\composite.pdf");
            
//Also see PdfDocument.RasterizeToImageFiles() method to flatten a PDF to images or thumbnails
Imports IronPdf
Imports System.IO
Imports System.Linq
Dim ImageFiles As var = Directory.EnumerateFiles("C:\project\assets").Where(() => {  }, (f.EndsWith(".jpg") OrElse f.EndsWith(".jpeg")))
' Convert the images to a PDF and save it.
ImageToPdfConverter.ImageToPdf(ImageFiles).SaveAs("C:\project\composite.pdf")
'Also see PdfDocument.RasterizeToImageFiles() method to flatten a PDF to images or thumbnails

PDF documents can be easily constructed from one or more image files using the IronPdf.ImageToPdfConverter Class.