.task {
   let imageURL = Bundle.main.url(forResource: "invoice", withExtension: "png")
   if let imageURL = imageURL {
      do {
         let request = RecognizeDocumentsRequest()
         let result = try await request.perform(on: imageURL)

         var text = ""
         if let document = result.first?.document {
            if let table = document.tables.first {
               for row in table.rows {
                  var rowContent = ""
                  for cell in row {
                     rowContent += "\(cell.content.text.transcript) "
                  }
                  rowContent = rowContent.trimmingCharacters(in: .whitespacesAndNewlines)
                  if !rowContent.isEmpty {
                     text += "\(rowContent)\n"
                  }
               }
               text += "\n"
            }
         }
         textFound = text
      } catch {
         print("Error performing the request: \(error)")
      }
   }
}