Post

Replies

Boosts

Views

Activity

Reply to PDFKit PDFPage.characterBounds(at:) returns incorrect coordinates iOS 18 beta 4
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.
Topic: App & System Services SubTopic: General Tags:
Mar ’25
Reply to CGPDFOperatorTableSetCallback fails with `ID' isn't an operator.
Hi Randy, seems you are working with CoreGraphics PDF lib. As iOS 18.x still has a PDFKit bug (see here: https://developer.apple.com/forums/thread/762788 ) I have been looking into CG myself. Getting text with a CG Scanner out of a PDF is quite doable, but getting the bounding boxes of those texts is quite a challenge. Since you seem to have experience with Core Graphics PDF routines, can you steer me to same sample code for getting bounding boxes of characters/words/text blocks out of a PDF page with Core Graphics? Thanks for any help! Regards, Klaus.
Topic: Graphics & Games SubTopic: General Tags:
Jan ’25
Reply to PDFKit PDFPage.characterBounds(at:) returns incorrect coordinates iOS 18 beta 4
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!?
Topic: App & System Services SubTopic: General Tags:
Jan ’25
Reply to iOS 18.x PDFKit Page.string and Page.attributedString return some text way out of oder
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!
Topic: App & System Services SubTopic: General Tags:
Jan ’25
Reply to iOS 18.x PDFKit Page.string and Page.attributedString return some text way out of oder
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.
Topic: App & System Services SubTopic: General Tags:
Jan ’25
Reply to PDFKit PDFPage.characterBounds(at:) returns incorrect coordinates iOS 18 beta 4
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.
Topic: App & System Services SubTopic: General Tags:
Dec ’24