iOS 18.4 beta 1 and 2 do not fix the issues.
Selection.bounds(at: page) delivers more correct results than page.characterBounds(at: index). But not as good as characterBounds(at) for iOS 17 and earlier.
// page: PDFPage
for (index, character) in page.enumerated() {
if character == "\n" || character == "\r" { continue }
let range = NSRange(location: index, length: 1)
guard let selection = page.selection(for: range) else { continue }
let charBounds = selection.bounds(for: page)
}
Do we still have a chance for a PDFKit bug fix from Apple?
Does Apple really think that PDFs are dead and it's not worth keeping its PDF libraries up to date? What about the billions of PDF documents out there and the millions more generated every day?
If you need character and word accurate text extraction with precise layout data, LLMs are still no substitute.