Convert Image to Word Document (DOCX) with OCR using C++

Image to DOCX OCR C++

Images and scanned documents may contain textual information that you might need to process further. You might have captured pictures of text documents using your smartphone that you want to convert to editable documents. For this, performing OCR on the images can prove to be helpful. With OCR, you can convert images to searchable and editable Word documents. To that end, this article will teach you how to convert images to Word documents using C++.

C++ API for Converting Images to Word Documents

Aspose.OCR for C++ is an optical character recognition API that can extract text from images. The API also enables you to convert images to Word Documents like DOC, DOCX, and TXT files. You can either install the API through NuGet or download it directly from the Downloads section.

PM> Install-Package Aspose.OCR.Cpp

Convert Image to Word Document using C++

Often you might need to search or edit the text in images, but you are unable to do so. By performing OCR on such images and converting them to Word documents, you can search and edit the text as needed. To achieve this, please follow the steps given below.

The following sample code shows how to convert an image to a Word document using C++:

Screenshot of the source image and output Word file
Screenshot of the source image and output Word file

Convert Skewed Image to Word Document using C++

Images and scanned documents can sometimes be skewed. With Aspose.OCR for C++ API, you can perform OCR on skewed images. The following are the steps to convert a skewed image to a Word document:

The following sample code shows how to convert a skewed image to a Word document using C++:

Screenshot of the source image and output Word file
Screenshot of the source image and output Word file

Get a Free License

In order to try the API without evaluation limitations, you can request a free temporary license.

Conclusion

In this article, you have learned how to convert images to Word documents using C++. Furthermore, you have seen how to calculate and use the skew angle of an image to perform OCR on skewed images. The API provides many additional features that you can explore in detail by visiting the official documentation. In case of any questions, please feel free to reach us on our free support forum.

See Also