The Syncfusion PDF Library is a robust .NET PDF library that converts images into high-quality PDFs. It supports multiple image formats, including Bitmap, JPEG, GIF, PNG, TIFF, ICO, and ICON. The library seamlessly integrates with WinForms, WPF, Blazor, ASP.NET MVC, ASP.NET Core, UWP, and Xamarin on Windows, Linux, and MacOS. Customize your PDFs with adjustable margin, orientation, and size settings for optimal results.
The following code snippet demonstrates the conversion of an image to PDF using Syncfusion .NET PDF Library.
// Create an instance of the ImageToPdfConverter class.
var imageToPdfConverter = new ImageToPdfConverter();
// Set the page size for the PDF.
imageToPdfConverter.PageSize = PdfPageSize.A4;
// Set the position of the image in the PDF.
imageToPdfConverter.ImagePosition = PdfImagePosition.TopLeftCornerOfPage;
// Create a file stream to read the image file.
using (var imageStream = new FileStream("Autumn Leaves.jpg", FileMode.Open, FileAccess.Read))
{
// Convert the image to a PDF document using the ImageToPdfConverter.
var pdfDocument = imageToPdfConverter.Convert(imageStream);
// Create a file stream for the output PDF file.
using (var outputFileStream = new FileStream(Path.GetFullPath("Output.pdf"), FileMode.Create, FileAccess.ReadWrite))
{
// Save the generated PDF document to the output file stream.
pdfDocument.Save(outputFileStream);
}
// Close the document.
pdfDocument.Close(true);
}
Explore the essential capabilities that make converting images to PDFs efficient and customizable.
TIFF images usually have multiple frames in a single file. To draw each frame on a page of a PDF document, you need to iterate each frame individually.
Customize the page size when converting an image to PDF. You can also adjust the image size to fit the page.
Apply transparency to an image while converting it to PDF document, The transparent image can be positioned across the page, subtly visible behind the text and other elements, creating a professional and polished watermark effect.
You can rotate the image clockwise or counterclockwise by 90, 180, or 270 degrees, or any custom angle. This functionality is useful for adjusting images that are not oriented correctly or for creating a dynamic and visually appealing presentation.
Discover valuable resources from our blog and knowledge base on converting images to PDF.
Explore these resources for comprehensive guides, knowledge base articles, insightful blogs, and ebooks.
Product Updates
Technical Support
Image-to-PDF conversion is the process of converting one or multiple image files (JPEG, PNG, TIFF, etc.) into a single PDF document. This allows for easier sharing, printing, and archiving of images.
You can extract images from a PDF document and reuse them for other purposes easily using the Syncfusion .NET PDF Library.
Syncfusion supports various image formats including JPEG, PNG, BMP, GIF, TIFF, etc., for conversion to PDF.
Yes, conversion methods allow you to combine multiple images into a single PDF document. This is particularly useful for creating photo albums, presentations, or reports.
Yes, scanned documents and photographs can be converted to PDF format using OCR (Optical Character Recognition optical character recognition).
The quality of images in a PDF document largely depends on the settings and compression options chosen during the conversion process.
Greatness—it’s one thing to say you have it, but it means more when others recognize it. Syncfusion is proud to hold the following industry awards.