How to create Searchable PDF using Image(with text) in macOS application?
I have been tried to rewrite using PDFOutline for searchable PDF using image(with text), but not able to generate the searchable PDF. And also I have tried vision framework to get the text and it's frame from the image.
label code, we have appended text recognition and related data into that, here is the snippet
let outlineEntry = PDFOutline()
if label.destination != nil {
let destination = label.destination!
let destinationRect = image.getBoundingBox(text:destination, pageRect:pageRect)!
let labelLocation = NSMakePoint(destinationRect.minX, destinationRect.maxY)
outlineEntry.destination = PDFDestination(page: page, at: labelLocation)
} else {
outlineEntry.destination = defaultOutlineDestination
}
self.pdfDocument.outlineRoot = self.outline
Then saved this pdfDocument on my local disk.
Please let me know any frameworks are available ?
Thanks in advance