Hi zdenop,
thanks for your tip, but I'm using the ProcessPages function, so it should write the head and footer part of the file itself.
BUT I've played a bit with ProcessPage() + BeginDocument() before and EndDocument() after and the resulting file has big differences. Sadly, the file is still corrupt.
So it seems the problem is based on the failing begin/enddocument function. But even there I'm experiencing mysterious bugs.
Using only EndDocument(), I have something like a footer at the end of the file:
But it suddenly stops at "Produce". But when I'm using BeginDocument(), ProcessPage() and then EndDocument() the file is ending with bytes and there is no "endstream" or "endobj".
I've updated to latest 4.1.3 version but problem still exists.
I tried to use 1:1 the code from the tesseract cli but it still does not work...