I am creating an iOS app that needs to parse the text from a PDF document. I can read the entire PDF document's text using the string
property, but if it's a large PDF document, this could cause delays for users.
From the documentation, I came across the beginFindString
function, which seems to asynchronously, with no return?
https://developer.apple.com/documentation/pdfkit/pdfdocument/beginfindstring(_:withoptions:))
Unfortunately I cannot find examples on how to use this function or its intended purpose/functionality, so any guidance would be appreciated.
My goal is to read the PDF document one line at a time, searching for newlines ('\n'), then parsing that line as needed. I'm hoping the beginFindString
function will be useful.