Urgent.News

What's breaking now, across thousands of outlets.

Tech

Page count is the wrong unit for estimating a PDF-to-text job

"How many pages?" is the first question anyone asks about turning a pile of PDFs into text, and it's the number that ends up in the estimate. I spent a day running seven English documents through a PDF extractor and counting, for each, how many places I'd have to touch afterwards. Pages were a poor predictor. One page of a book printed in 1734 needed more fixes than two pages of an arXiv paper,…

When estimating the cost of converting PDFs to text, the number of pages is not the best metric to use. In a test, seven English documents were run through a PDF extractor, and it was found that page count alone is a poor predictor of how many edits will be required. One example is a book printed in 1734, which had more editing needed per page than an arXiv paper with only two pages.

The type of edit also matters more than the number itself. For instance, a wrong, missing or extra word, a fused line, a word broken across a line end, two conflicting versions of one line, or a block in the wrong position all count as spots. These spots are counted once, regardless of how many characters they cover. Page furniture, such as running heads, footers, and page numbers, is not included in the count because they are typically stripped anyway.

To test this, four synthetic files were created with known content, while two scanned public-domain books were transcribed and compared using Python's difflib, which counts moved phrases twice. The PDF extractor used was ImgIng's Extract PDF content with OCR on Auto. The results showed that spots can be categorized into three groups: fixes that a script can handle, spots that need a person to look at, and spots where editing is the wrong move and the page should be rerun through OCR.

The script can fix up to 85% of the issues, but a person is needed for the remaining spots, which highlights the limitations of using page count for estimating a PDF-to-text job.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in Tech

I treated publishing as a queue. The queue lied.

On September 11, the publishing ledger said 29 articles while the public profile showed 30 . I had one stale editor buffer, one repaired series assignment, and no trustworthy answer to a simple…

  • Reporter treated publishing system as a queue, but it was a small distributed system.
  • Multiple histories existed in the queue: editorial rotation, public list, and browser session.
  • Mistake assumed counts represented the same thing, leading to duplicate publications.

Getting the text out of five screenshots inside one PDF

The document is a three-page weekly ops report with five screenshots pasted in: a growth dashboard, a chat channel, a spreadsheet, an alert and a kanban board.

  • Five screenshots in three-page report contain diverse tools
  • ImgIn's OCR tool extracts text from all screenshots accurately
  • Spreadsheet data tab-separated for easy spreadsheet import

More from Saturday 12 September →