iOS 18.3 beta 3 (22D5055b5) does not fix the issue!
I have tested text extraction through the lower level CoreGraphics framework with CGPDFScannerScan(). It returns the same correct text results on iOS 17 and iOS 18!
Seems this is a PDFKit bug, not a lower-level CoreGraphics bug.
How can I help to further analyse this PDFKit issue and eventually get this Apple framework bug fixed!?
Post
Replies
Boosts
Views
Activity
I have sent in two new bug reports, one for Page.string (FB16313297) and one for Page.attributedString (FB16313295). I included screenshots and the sample project that shows the issue in code.
Thank you for forwarding these reports to the right people!
I really hope that those bugs, especially the characterBounds(at:) bug FB14843671 are fixed soon!
Thank you for your detailed reply and suggestion to separate into two feedbacks!
I will split/update the feedback as soon as I can manage.
FYI, I have filed the Page.characterBounds(at:) bug under FB14843671 already in August '24 during the beta cycle. But have so far seen neither any Apple reaction, bug confirmation nor a bug fix.
That made me wonder that I missed something or even reported a non-bug. But looking into the issue again in more detail I have to reconfirm my view that there is an Apple framework issue.
This means that with iOS 18 release the large majority of the users of my app is completely stripped of a core feature, i.e. importing, semantically analysing and parsing PDF scripts (of actors) because of that bug. Really tough to cope with.
iOS 18.3 beta (22D5034e) does not fix the issue!
iOS 18.2 (22C152) does not fix the issue, either!
iOS 18.2 RC2 (22C151) is still not fixing the PDFKit.characterBounds(at:) bug.
The app breaking PDFKit bug is still not fixed! Soon there is end of year but still not fixed!
I really do not understand why an established Apple framework does not get fixed during the beta cycle. Even less so that it is not yet fixed while we are into the second point-update of the new OS.
During the iOS 17 beta cycle I had reported the same bug and it got fixed within two weeks.
What a surprisingly bad developer experience.
iOS 18.2 beta 2 (22C5125e) does not fix the issue, either.
FYI, neither iOS 18.1 RC nor 18.2 beta 1 resolves the issue.
iOS 18.1 beta 7 does not fix the this bug.
Is this even confirmed as a bug in iOS 18.x?
Would be great if someone from Apple could confirm it is a bug and that it is in the backlog for getting resolved. Thanks in advance!
iOS 18.1 beta 5 does not resolve the PDFKit PDFPage.characterBounds(at:) issue of returning the wrong character bounds.
It seems I do get the same crash on my iOS code. I could not reproduce it, but get between 1 and 4 crashes from every 200 user sessions. Any hints on how to solve this issue would be highly appreciated.
Here is my code (very similar to code shown above):
private func transcribe() {
guard let recognizer, recognizer.isAvailable else {
print("--- SpeechRec.transcribe - SpeechRecognizer TRANSCRIBE ERROR: \(RecognizerError.recognizerIsUnavailable)")
return
}
do {
if let audioEngine {
let request = SFSpeechAudioBufferRecognitionRequest()
request.shouldReportPartialResults = true
request.requiresOnDeviceRecognition = false // might fix speechRec error 1101 in console
let audioSession = AVAudioSession.sharedInstance()
try audioSession.setCategory(.playAndRecord, mode: .measurement, policy: .default, options: .duckOthers)
try audioSession.setActive(true, options: .notifyOthersOnDeactivation)
let inputNode = audioEngine.inputNode
let recordingFormat = inputNode.outputFormat(forBus: 0)
inputNode.installTap(onBus: 0, bufferSize: 1024, format: recordingFormat) { (buffer: AVAudioPCMBuffer, _) in
request.append(buffer)
}
try audioEngine.start()
self.recognitionTask = recognizer.recognitionTask(with: request, delegate: self)
} else {
let (audioEngine, request) = try Self.prepareEngine()
self.audioEngine = audioEngine
self.request = request
self.recognitionTask = recognizer.recognitionTask(with: request, delegate: self)
}
} catch {
Logger.audio.error("--- SpeechRec.transcribe - SpeechRecognizer AudioSession/AudioEngine ERROR: \(error)")
self.reset()
}
}
This is the backtrace that the Organizer shows in Xcode:
Last Exception Backtrace (0)
#0 (null) in __exceptionPreprocess ()
#1 (null) in objc_exception_throw ()
#2 (null) in +[NSException raise:format:arguments:] ()
#3 (null) in AVAE_RaiseException(NSString*, ...) ()
#4 (null) in AVAudioIONodeImpl::SetOutputFormat(unsigned long, AVAudioFormat*) ()
#5 (null) in AUGraphNodeBaseV3::CreateRecordingTap(unsigned long, unsigned int, AVAudioFormat*, void (AVAudioPCMBuffer*, AVAudioTime*) block_pointer) ()
#6 (null) in -[AVAudioNode installTapOnBus:bufferSize:format:block:] ()
#7 0x100d34e10 in SpeechRecognizer.transcribe() at /Users/klaus/Developer/ScriptBuddy/ScriptBuddy/Assistants/SpeechRecognizer.swift:245
#8 0x100d34298 in SpeechRecognizer.startTranscribing(andCompareTo:) at /Users/klaus/Developer/ScriptBuddy/ScriptBuddy/Assistants/SpeechRecognizer.swift:167
#9 (null) in Script.speakNextScriptElement() ()
#10 0x100d43bfc in specialized SpeechSynthesizer.speechSynthesizer(_:didFinish:) at /Users/klaus/Developer/ScriptBuddy/ScriptBuddy/Assistants/SpeechSynthesizer.swift:942
#11 (null) in SpeechSynthesizer.speechSynthesizer(_:didFinish:) ()
#12 (null) in @objc SpeechSynthesizer.speechSynthesizer(_:didFinish:) ()
#13 (null) in -[AVSpeechSynthesizer(PublicSpeechImplementation) processSpeechJobFinished:successful:] ()
#14 (null) in -[AVSpeechSynthesizer(PublicSpeechImplementation) _handleSpeechDone:successful:] ()
#15 (null) in __67-[AVSpeechSynthesizer(PublicSpeechImplementation) _speakUtterance:]_block_invoke_6 ()
#16 (null) in __46-[TTSSpeechManager _speechJobFinished:action:]_block_invoke ()
#17 (null) in _dispatch_call_block_and_release ()
#18 (null) in _dispatch_client_callout ()
#19 (null) in _dispatch_main_queue_drain ()
#20 (null) in _dispatch_main_queue_callback_4CF ()
#21 (null) in __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ ()
#22 (null) in __CFRunLoopRun ()
#23 (null) in CFRunLoopRunSpecific ()
#24 (null) in GSEventRunModal ()
#25 (null) in -[UIApplication _run] ()
#26 (null) in UIApplicationMain ()
#27 (null) in closure #1 in KitRendererCommon(_:) ()
#28 (null) in runApp<A>(_:) ()
#29 (null) in static App.main() ()
#30 (null) in static ScriptBuddyApp.$main() ()
#31 (null) in main ()
#32 (null) in start ()
The latest Xcode / iOS RC candidates still have the same issue that PDFKits PDFPage.characterBounds(at:) is returning incorrect coordinates for characters on the PDF page.
This breaks apps that rely on PDFKit to read char positions from PDF files!
It should be fixed by Apple before the final release of iOS 18.
Yeah, sure! Thank you for commenting! I thought it might be a know "wrong" coding pattern or even a iOS 18 beta bug, as it is not showing up in iOS 17.x.
Will try to create a small reproducible example and post it here.
Any news on this topic? Still not working in the latest betas.