When tesseract is fed a JPG image of an upright document and
instructed to produce a searchable PDF, it flips the image on its
side. The rotation apparently happens before OCR is performed judging
from the text produced (as pdf2txt shows it as one character per
line). This is the syntax used:
$ tesseract color_document.jpg sideways_doc -l eng+nld pdf
The workaround is quite ugly:
$ pdftk doc_sideways_doc.pdf cat 1-r1east output upright_doc.pdf
$ ocrmypdf --force-ocr -l eng+nld upright_doc.pdf proper.pdf
I don’t think this bug affects every document. It’s perhaps trying to
be smart and detect the orientation of the doc & misjudging it. If
that’s true, it’s a shame that tesseract does this automatically and
beyond the control of the user. There is no option to force tesseract
to leave the orientation as-is.