Image to PDF OCR

Images and scanned documents often contain valuable textual information. With the power of Optical Character Recognition (OCR), you can convert these images into searchable PDF documents programmatically using C#. This 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

To efficiently perform OCR operations on images or scanned documents, you can use the Aspose.OCR for .NET API. Installation is straightforward; you can download the DLL file from the New Releases section or install it via NuGet with 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#:

  1. Set the path for the input image to be recognized.
  2. Initialize an instance of the AsposeOcr class.
  3. Use the RecognizeImage method to recognize the input image.
  4. 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#

Sometimes, images may 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:

  1. Specify the path for the input image.
  2. Initialize an instance of the AsposeOcr class.
  3. Create an instance of the RecognitionSettings class.
  4. Calculate the skew angle of the image.
  5. 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:

Image to PDF OCR

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 more 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