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

         var text = ""
         if let document = result.first?.document {
            for barcode in document.barcodes {
               text += "Barcode: \(barcode.payloadString ?? "Illegible")\n"
            }
         }
         textFound = text
      } catch {
         print("Error performing the request: \(error)")
      }
   }
}