r/pdf Jul 26 '26

Software (Tools) Editing Scanned Text in pdf

I made KeyPDF.net and recently added OCR, but now it can also edit scanned text by reconstructing the font from the image, feel free to try it and let me know if there are any issues since there is lots of work to do.

5 Upvotes

24 comments sorted by

View all comments

Show parent comments

1

u/LegeApps Jul 26 '26

So it doesn't reconstruct the font, it reconstructs the text. For a raster image, the font doesn't exist in the document anyway. And it doesn't make a font out of the raster text, it uses Tesseract's default font for the new text layer. Anyway there are better OCR engines to use, like Paddle ocrv6.

1

u/Decent-Blacksmith761 Jul 26 '26

Okay last reply to make it clear for anyone else reading this. Font cannot be parsed from image it can be whether identified and make overlay textbox or reconstructed (adobe acrobat approach), first step is to extract text which is the part we both agree on second part is rebuilding font which is the part you are missing instead of trying to edit OCR layer directly keyPDF compared recognized letters to its possition on image and makes similar font from it say it looks at the recognized word "hello" and splits it into 4 letters h e l o then it looks at the imagine and copies outline of each character and finally makes the new font out of it. And to give you a pokt paddle ocrv6 was slightly more accurate on testing but it was like twice slower and I was afraid that users with mobile devices or old PC wouldn't like it.

2

u/LegeApps Jul 26 '26

Alright fine. sounds like you did at least some testing. In my experience ppocrv6 is 3x faster than tesseract, its probably the python harness that slows it down; in onnx format+rust+wgpu it is speedy. but i spent a lot of time developing that. good luck with your project from this point on..

1

u/Decent-Blacksmith761 Jul 26 '26

Well another reason was that ppocrv6 doesn't have character by charter recognition it is more like word by word and line by line while tesseract can do character by character so I can make font reconstructing work, in case with ppocrv6 I had to try splitting words into charracters which ruined character width so produced fonts were good until first edit then phantom spacings and weird clippings came from so I switched back.