Images or scanned documents can contain textual information. You can convert a scanned document or an image to a searchable PDF document with OCR programmatically using C#. So the JPG, PNG, TIFF, BMP, and other format images can be converted to searchable PDF files. Please refer to the following sections for further details:
- 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
Aspose.OCR for .NET API can efficiently perform OCR operations on images or scanned documents. You can configure the API by downloading the DLL file from the New Releases section, or with the following NuGet installation command:
PM> Install-Package Aspose.OCR
Convert Image to Searchable PDF with OCR Programmatically using C#
You can convert a JPG, PNG, TIFF and other image formats to a searchable PDF with OCR by following the steps below:
- Set path for input image to recognize.
- Initialize AsposeOcr class instance.
- Recognize input image with RecognizeImage method.
- Save output to searchable PDF file.
The code below shows how to convert JPG, PNG, TIFF, and other image formats to searchable PDF with OCR using C#:
Convert Skewed Image to Searchable PDF with OCR Programmatically in C#
Images can sometimes be skewed for different reasons. Sometimes you may know the skew angle of the images and specify it before recognizing the image, however, you can calculate the skew angle with the API when you do not know the angle. The following steps show how to convert a skewed image to a searchable PDF file:
- Specify the path for input image.
- Initialize AsposeOcr class object.
- Initialize RecognitionSettings class instance.
- Calculate the skew angle of the image.
- Recognize the image and save output searchable PDF file.
The following code shows how to convert a skewed image to searchable PDF file programmatically using C#:
Below is a screenshot of the input image and output PDF file:
Get Free Evaluation License
You can evaluate the API without any limitations by requesting a Free Temporary License.
In this article, you have explored how to convert an image to a searchable PDF file programmatically using C#. A JPG, PNG, BMP, TIFF as well as a scanned document can be converted to a PDF file. You can explore other features of the API by visiting the Documentation section and feel free to contact us at Free Support Forum for any of your concerns.