Article View: alt.windows7.general
Article #45Re: OCR
From: Paul
Date: Tue, 13 Oct 2026 05:59
Date: Tue, 13 Oct 2026 05:59
133 lines
6575 bytes
6575 bytes
On Fri, 10/9/2026 12:53 PM, Wendelin Uez wrote:
>> When you say "recognize the structure and properties", do you mean
>> actually produce a result file that's in columns, or just not be
>> confused by such a layout?
>
> The documents I have to convert contain to types of text layozt, either
> floating text with differences in font size and use of bold (which should
> be represented in the target document), or a tabbed list containig per line
> a short text with some words only, a tab space, and a second text group.
> Nothing else, but both formats mixed in the same document.
A search string might be:
linux ocr document reconstruction
The property you are asking for, is document reconstruction,
where the bold and italics are preserved. Some OCR tools have
HTML output or "markdown text" format. In Markdown, asterisks
are used as string modifiers. *text* **text** ***text***
Those indicate Bold/Italics.
While an HTML format and a Markdown format can potentially
represent Bold and Italics, it is not really all that likely
that the OCR people will attempt to provide that information.
I looked at LLM-AI OCR items, and most of my efforts were too
pathetic to succeed. I even tried using a regular LLM-AI,
pasted an image right into the query box, and... it did OCR!
But the output text, the stupid tool did not output "verbatim"
what the OCR revealed. The stupid AI had to "re-write" the text
and mess it up. Giant fail, as a document reconstruction attempt.
But it was still pretty funny, to see an LLM-AI not listing OCR
capability, could actually do OCR when asked. When I used the
File-Open dialog on the LLM-AI local model hosting software,
the LLM-AI kept telling me it "could not access the file".
It was when I pasted a 300DPI image I'd copied, into the
dialog box, it started to chew on that and after a few minutes,
it output a (sorta) text representation. I love surprises.
*******
Today, I went back to conventional techniques. The host OS was
Ubuntu 26.04 (as I wanted up-to-date packages and this was an
attempt to reduce the fuss while trying to get it to work).
These are examples of what worked in Ubuntu 26.04 .
$ snap install simple-text-extractor
simple-text-extractor 1.6 from Gaetan Sencie (stens66) installed
$ simple-text-extractor # GUI-only, select testdoc-pixmap.pdf inside the tool
# Don't click any tick boxes.
# Should make testdoc-pixmap_ocr.pdf as output
$ pdftotext -layout testdoc-pixmap_ocr.pdf # Makes testdoc-pixmap_ocr.txt
$ cat testdoc-pixmap_ocr.txt # Dump the text to the screen for a look
# A good quantity of white space is removed
# but not all of it is removed.
# The "Sheet1" and "Page1" labels are from
# LibreOffice Calc (=Excel).
Sheet1
Institution Amount
JolityFarm $10.00
PieShop $100.00
Rebate $1,000.00
The quick brown fox jumped over the lazy hen.
Four and twenty black birds all in a row.
This would be a series of paragraphs if it was
a series of paragraphs.
Page 1
# It has mostly preserved the spacing but removes
# a lot of the more wasteful white space. This was a Letter format page.
# The margins were removed.
******* Now, we test a second OCR package, one with "unpaper" for deskew and thresholding
# Advantage of this method, is it is command-line based. You can process
# more documents in one run this way. The other method was GUI based.
$ sudo apt install ocrmypdf ocrmypdf-doc # The doc is in HTML format, for Firefox.
$ ocrmypdf testdoc-pixmap.pdf testdoc-pixmap-ocrmypdf.pdf # No doc cleanup, just convert it.
$ pdftotext -layout testdoc-pixmap-ocrmypdf.pdf # Makes testdoc-pixmap-ocrmypdf.txt
$ cat testdoc-pixmap-ocrmypdf.txt # Notice the amount of white space
# suppressed is slightly different.
Sheet1
Institution Amount
JolityFarm $10.00
PieShop $100.00
Rebate $1,000.00
The quick brown fox jumped over the lazy hen.
Four and twenty black birds all in a row.
This would be a series of paragraphs if it was
a series of paragraphs.
Page 1
******* End-of-experiments *******
Anyway, that's not remotely "document reconstruction", but
this is an almost workable alternative. Your "Bold" is not
preserved. But you might get some usage from this.
Having a product that can do this on Windows 7 ?
It is possible, but the software would have to be pretty
crusty if it was still for sale. Maybe an ABBYY product
could do it ? Not sure.
Really, what changed today, is getting "pdftotext" working.
Once I discovered the -layout option, I was in business.
Paul
Technical Details
Message-ID:
<11akhbf$92ns$1@dont-email.me>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!eternal-september.org!feeder.eternal-september.org!nntp.eternal-september.org!.POSTED!not-for-mailReferences:
<119vf9d$udo7$1@solani.org> <11a17tq$1cssr$1@dont-email.me> <11ab671$16s9q$7@solani.org>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!eternal-september.org!feeder.eternal-september.org!nntp.eternal-september.org!.POSTED!not-for-mail From: Paul <nospam@needed.invalid> Newsgroups: alt.windows7.general Subject: Re: OCR Date: Tue, 13 Oct 2026 01:59:09 -0400 Organization: A noiseless patient Spider Lines: 133 Message-ID: <11akhbf$92ns$1@dont-email.me> References: <119vf9d$udo7$1@solani.org> <11a17tq$1cssr$1@dont-email.me> <11ab671$16s9q$7@solani.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Injection-Date: Tue, 13 Oct 2026 05:59:11 +0000 (UTC) Injection-Info: dont-email.me; logging-data="297724"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/YbHjqVD+sgbga6KZm0rfRK7MtTP02z9E="; posting-host="02a6979454ea75d9f0853b790c4fb8ae" User-Agent: THIS SPACE FOR RENT Cancel-Lock: sha1:0woqlRBjmkvlg5cROUwtk+zmOdw= sha256:IhupuUkLlT2+dtWRfLRw3lXr8jN+L145PAS04Nw9m0k= sha1:4an0OgEWRL9Q5mAnyshGCPZvfCg= sha256:NwGYx8jblpqS7ouvRcMihLQoaVHUytwVnD0wdNU4b2s= In-Reply-To: <11ab671$16s9q$7@solani.org> Content-Language: en-US