
Images and scanned documents often contain valuable textual information. By leveraging Optical Character Recognition (OCR), you can convert these images into searchable PDF documents programmatically using C#. This powerful process allows you to transform various image formats, including JPG, PNG, TIFF, and BMP, into searchable PDFs. Below are the key sections to guide you through the process:
- Image to Searchable PDF Converter with OCR – C# API Installation
- Convert Image to Searchable PDF with OCR Programmatically using C#
- Convert Skewed Image to Searchable PDF with OCR Programmatically in C#
Image to Searchable PDF Converter with OCR – C# API Installation
To effectively perform OCR operations on images or scanned documents, you can utilize the Aspose.OCR for .NET API. The installation process is straightforward; you can download the DLL file from the New Releases section or install it via NuGet using the following command:
PM> Install-Package Aspose.OCR
Convert Image to Searchable PDF with OCR Programmatically using C#
Follow these steps to convert JPG, PNG, TIFF, and other image formats to a searchable PDF using OCR in C#:
- Set the path for the input image you wish to recognize.
- Initialize an instance of the AsposeOcr class.
- Use the RecognizeImage method to recognize the input image.
- Save the output as a searchable PDF file.
Here’s a sample code snippet demonstrating how to convert images to searchable PDFs using C#:
Convert Skewed Image to Searchable PDF with OCR Programmatically in C#
Images may sometimes be skewed due to various factors. If you know the skew angle, you can specify it before recognition. However, if the angle is unknown, the API can calculate it for you. Follow these steps to convert a skewed image to a searchable PDF:
- Specify the path for the input image.
- Initialize an instance of the AsposeOcr class.
- Create an instance of the RecognitionSettings class.
- Calculate the skew angle of the image.
- Recognize the image and save the output as a searchable PDF file.
Here’s how to programmatically convert a skewed image to a searchable PDF using C#:
Below is a screenshot illustrating the input image alongside the output PDF file:

Get Free Evaluation License
You can evaluate the API without any limitations by requesting a Free Temporary License.
Conclusion
In this article, you have learned how to convert images to searchable PDF files programmatically using C#. Whether you’re working with JPG, PNG, BMP, TIFF, or scanned documents, the process is straightforward with the Aspose.OCR API. For additional features and detailed documentation, visit the Documentation section. If you have any questions, feel free to reach out through our Free Support Forum.
See Also
With the Aspose Plugin, you can efficiently develop searchable PDFs from images using C#. This solution is not only cost-effective at $99, but it also ensures high-quality OCR PDF conversion and seamless integration into your .NET applications. Whether you are looking for a C# OCR PDF conversion library or a .NET image to searchable PDF solution, the Aspose Plugin is your best choice for OCR implementation in C# for PDF generation.
By following this guide, you can convert scanned images to searchable PDFs in C#, utilizing the best C# OCR library for PDF to achieve high-performance OCR image to PDF conversions. Start building your own searchable PDF converter with C# today!