Repository navigation
Replies: 1 comment 7 replies
|
You're referring to the positioning of the text baseline and the underline. In a normal font, the font itself specifies where to put the underline. Tesseract calculates the baseline of the recognized text, and in ocrmypdf v17+, then places the recognized 'Noto' font underneath. For various reasons the alignment of Noto to the recognized text isn't perfect, and getting underline right means the underline position in Noto has to be a position that is naturally for the bitmap image. Of course, I can't tell if you used ocrmypdf v17+, and I can't tell if you have Noto installed (although most modern systems do). If you don't have Noto, we fall back to the Occulta font, which would be even more wrong, because it doesn't have real glyph metrics, just broad categories. If you really need to get it right on a specific PDF, a tool like Foxit can select the recognized invisible text objects, and you could shift them down or up slightly, then that should reposition the underline. |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
There's lots of technical terms for PDFs, so "Bounding Box margin" may not be the correct term.
But, the issue is as follows:
Command:
With the default ocrmypdf, I get a text boundary that tightly hugs the font. When I then annotate the PDF with an underline, the underline slices through the very bottom of the text.
To put it another way: When I underline text via annotation, I get a strikethrough aligned at the very bottom of the text, inside the letters not below it.
I would like to ocr the PDF such that when I underline, it goes beneath the text. I assume (from looking at other PDFs created from other sources) that I need to somehow widen the box around the text. I know enough about the PDF spec to know that there are countless possible paths to do this.
So I am asking here.
CURRENT

DESIRED

All reactions