Image to PDF conversion using C# .NET API

Image to PDF conversion

A picture is worth a thousand words“. The ideas can be conveyed by a single still image in an efficacious mechanism than a mere verbal description. Therefore, images are widely used in daily life. A large variety of image formats including JPEG, PNG, BMP, GIF, TIFF, etc are used for information sharing. However, if we stumble upon a requirement to share a large set of images, either we need to archive them into one bundle or make a booklet in a format that can be easily viewed on receiving end. So, our choice is Portable Document Format (PDF) because it maintains the document fidelity irrespective of application software, hardware as well as Operating System being used for viewing the file. Therefore, in this article, we are going to talk about the Image to PDF conversion feature using Conholdate.Total for .NET APIs.

However, before we proceed further, let’s discuss some points highlighting a difference between Conholdate.Total for .NET and Aspose.Total for .NET.

Aspose.Total for .NET is a collection of programming APIs specifically developed to create, manipulate and transform leading file formats. It includes Word, Excel, PDF, PowerPoint, Outlook, Diagram, MS Project, HTML, and more than other 100 file formats all within the standard desktop, Console, ASP.NET, and VB.NET applications.

Albeit, Conholdate.Total for .NET also includes Aspose.Total for .NET. But, it also includes GroupDocs.Total for .NET. It provides extra capabilities to view, convert, annotate, compare, sign, assemble, edit, search, and parse the most commonly used document formats. So in this single package, you get the capabilities to load files, view them, manipulate them and render the output in other supported formats i.e. Load MS Word file and save into JPEG format.

So in this article, we are going to discuss the feature to load the raster image file and save the output in PDF format using C# .NET.

Convert Image to PDF in C#

The API is a leading programming solution offering the capabilities to deal with MS Word (DOC, DOCX, RTF, DOT, DOTX, DOTM, DOCM), OpenOffice: ODT, OTT files. The API empowers the developers to modify, generate, render, convert and print documents without using Microsoft Word. It supports the feature to render the output in DOC, RTF, HTML, OpenDocument, PDF, XPS, EPUB, and many more. So we can use this API for Image to PDF conversion.

In order to use the API, you may either download the .dll or open NuGet package manager, search for Aspose.Words and install. Please run the following command on Package Manager Console to install it.

Install-Package Aspose.Words -Version 21.3.0  

Please follow the steps given below to perform the conversion operation

C#.NET

  • Create an instance of Document class.
  • Create an instance of DocumentBuilder and pass the Document object as an argument.
  • Call InsertImage(…) method of DocumentBuilder class and pass source image path as argument.
  • Call Save(..) method and provide resultant file name as argument.

Get a Free License

In order to use the API without any limitations, please consider requesting a Free temporary license.

Conclusion

In this article, we have learned about the capabilities of Conholdate.Total for .NET package for the conversion of raster images to PDF format.

Related articles

You may consider visiting following links for details on