I've used tesseract but I haven't used C programming to access it which is in your skills required, I'll just write what I have done with it and if it matches what you need maybe you will accept my proposal.
So.. In my case I've used OCR with files that have been scanned in from our printers. So basically, pictures, or non-OCR pdf documents.
I'm just using a short powershell script to check in a folder where the scanned documents are, I split them up to separate pages with ImageMagick, then using ImageMagick again I rotate them to the correct orientation (this has been 99.9% correct in my tests) and once all pages has been split up and rotated I run Tesseract on then and save them all together in a PDF file.
It's not a super pretty solution, but it works, if this is what you are looking for then please contact me.
Best regards
Fredrik