Using Xojo 2024 r1
How do I rotate an image of text. I need to detect the current orientation and then rotate it to 0.
I tried passing this to a shell command but it does not work. (no output). It does not have to be done in a command line. I just need to rotate the png image and then save the new rotated png image. Then a new text file will be created using Tesseract and that text is sent to chatgpt. I know that some of you are doing OCR, please help if you can. Or if you know a better way?
It starts out as a scanned pdf file, I use pdftoppm to extract the images.
Thanks
e = "for i in " + newpng.shellpath + "*.png; do tesseract ""$i"" " + newpng.shellpath + "output --psm 0 -c tessedit_create_txt=1 orientation=$(grep ""Orientation in degrees"" " + newpng.shellpath + "output.txt | awk '{print $5}') convert ""$i"" -rotate -$orientation " + newpng.shellpath + "output.png"
s.Execute(e)