using IronPdf;string imagePath = "meetOurTeam.jpg";// Convert an image to a PDFPdfDocument pdf = ImageToPdfConverter.ImageToPdf(imagePath);// Export the PDFpdf.SaveAs("imageToPdf.pdf");
using IronPdf;
string imagePath = "meetOurTeam.jpg";
// Convert an image to a PDF
PdfDocument pdf = ImageToPdfConverter.ImageToPdf(imagePath);
// Export the PDF
pdf.SaveAs("imageToPdf.pdf");
ImportsIronPdfPrivate imagePath AsString = "meetOurTeam.jpg"' Convert an image to a PDFPrivate pdf AsPdfDocument = ImageToPdfConverter.ImageToPdf(imagePath)' Export the PDFpdf.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")
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 PDFPdfDocument pdf = ImageToPdfConverter.ImageToPdf(imagePaths);// Export the PDFpdf.SaveAs("imagesToPdf.pdf");
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");
ImportsIronPdfImportsSystemImportsSystem.Collections.GenericImportsSystem.IOImportsSystem.Linq' Retrieve all JPG and JPEG image paths in the 'images' folder.Private imagePaths AsIEnumerable(OfString) = Directory.EnumerateFiles("images").Where(Function(f) f.EndsWith(".jpg") OrElse f.EndsWith(".jpeg"))' Convert images to a PDFPrivate pdf AsPdfDocument = ImageToPdfConverter.ImageToPdf(imagePaths)' Export the PDFpdf.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")
using IronPdf;using IronPdf.Imaging;string imagePath = "meetOurTeam.jpg";// Convert an image to a PDF with image behavior of centered on pagePdfDocument pdf = ImageToPdfConverter.ImageToPdf(imagePath, ImageBehavior.CenteredOnPage);// Export the PDFpdf.SaveAs("imageToPdf.pdf");
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");
ImportsIronPdfImportsIronPdf.ImagingPrivate imagePath AsString = "meetOurTeam.jpg"' Convert an image to a PDF with image behavior of centered on pagePrivate pdf AsPdfDocument = ImageToPdfConverter.ImageToPdf(imagePath, ImageBehavior.CenteredOnPage)' Export the PDFpdf.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")
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 headerPdfDocument pdf = ImageToPdfConverter.ImageToPdf(imagePath, options: options);// Export the PDFpdf.SaveAs("imageToPdfWithHeader.pdf");
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");
ImportsIronPdfPrivate imagePath AsString = "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 headerPrivate pdf AsPdfDocument = ImageToPdfConverter.ImageToPdf(imagePath, options:= options)' Export the PDFpdf.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")
What are the rendering customization options available in IronPDF?
IronPDF allows you to use the `ChromePdfRenderOptions` object to customize the rendering process. This includes options like JavaScript execution, CSS media types, and custom headers. You can also incorporate web fonts and icons for a more polished document.
Is it possible to convert a PDF back to an image using IronPDF?
Yes, IronPDF supports converting or rasterizing PDF documents back into images. This can be useful for various applications that require different formats for distribution or presentation.
Can IronPDF work on different operating systems?
IronPDF is versatile and can operate across Windows, macOS, and Linux environments, making it an excellent choice for various development platforms.
How do I optimize PDF size when combining multiple images using IronPDF?
IronPDF offers PDF compression options to optimize the file size when merging multiple images. It's especially useful when creating large digital portfolios or photo albums, ensuring quality is maintained without large file sizes.