Browse Source

Improved code

Signed-off-by: Marino Faggiana <marino@marinofaggiana.com>
Marino Faggiana 2 years ago
parent
commit
ebbd28ba02
1 changed files with 3 additions and 2 deletions
  1. 3 2
      iOSClient/Main/Create cloud/NCUploadScanDocument.swift

+ 3 - 2
iOSClient/Main/Create cloud/NCUploadScanDocument.swift

@@ -132,7 +132,8 @@ class NCUploadScanDocument: ObservableObject {
             image = changeCompressionImage(image, quality: quality)
             let bounds = CGRect(x: 0, y: 0, width: image.size.width, height: image.size.height)
             if isTextRecognition {
-
+                UIGraphicsBeginPDFPageWithInfo(bounds, nil)
+                image.draw(in: bounds)
             } else {
                 UIGraphicsBeginPDFPageWithInfo(bounds, nil)
                 image.draw(in: bounds)
@@ -427,8 +428,8 @@ struct NCUploadConflictRepresentedView: UIViewControllerRepresentable {
 
 struct PDFKitRepresentedView: UIViewRepresentable {
 
-    @Binding var url: URL
     typealias UIView = PDFView
+    @Binding var url: URL
 
     func makeUIView(context: UIViewRepresentableContext<PDFKitRepresentedView>) -> PDFKitRepresentedView.UIViewType {
         let pdfView = PDFView()