Create searchable pdf with c++ and tesseract

Many office machines creates pdf as result of scan instead of image. Unfortunately not always they includes also text layer for copy&paste or they include text layer based on default language of scanner and not document language. In such cases you can use tesseract to crete "searchable pdf".