Parcourir la source

【2025】【Edit】Link模块完善

niehaoyu il y a 4 mois
Parent
commit
2b57ca81b3

+ 4 - 0
PDF Office/PDF Master/KMClass/KMNPDFPageEdit/KMNThumbnailManager.swift

@@ -29,6 +29,10 @@ public class KMNThumbnail: NSObject {
         }
     }
     
+    deinit {
+        print("\(self.className) deinit")
+    }
+    
     public init(document: CPDFDocument,currentPageIndex:Int) {
         thumbnailDocument = document
         pageIndex = currentPageIndex

+ 14 - 3
PDF Office/PDF Master/KMClass/KMPDFViewController/EditTool/KMLinkViewController/Views/KMLinkPageView/KMLinkPageView.swift

@@ -58,8 +58,6 @@ public class KMLinkPageView: BaseXibView {
         self.setUpUI()
     }
     
-    
-    
     func setUpUI() {
         infoContendView.wantsLayer = true
         if let value = ComponentLibrary.shared.getComponentValueFromKey("radius/m") {
@@ -113,7 +111,18 @@ public class KMLinkPageView: BaseXibView {
         
         choosedIndex = paginationView.properties.currentIndex
         startPageIndex = paginationView.properties.currentIndex
-        
+         
+        refreshPage()
+    }
+    
+    func refreshPage() {
+        guard let pdfView = self.pdfView else {
+            return
+        }
+        let thumbnail = KMNThumbnail.init(document: pdfView.document, currentPageIndex: choosedIndex-1)
+        thumbnail.generateThumImage { image in
+            self.pageImage.image = image
+        }
     }
     
     func refreshGoButton() {
@@ -156,6 +165,8 @@ extension KMLinkPageView: ComponentPaginationDelegate {
             
             isGo = false
             
+            refreshPage()
+            
             refreshGoButton()
         }
     }

+ 5 - 1
PDF Office/PDF Master/KMClass/KMPDFViewController/KMMainViewController.swift

@@ -881,6 +881,10 @@ import KMComponentLibrary
         
     }
     
+    func updateEditModeDocumentWhenPageChanged() {
+        
+    }
+    
     //MARK: - Crop裁剪
     func showCropController() {
         listView.isHidden = true
@@ -2252,7 +2256,7 @@ extension KMMainViewController: CPDFViewDelegate,CPDFListViewDelegate {
         }
         
         //水印
-        updateWatermarkDocument()
+        updateEditModeDocumentWhenPageChanged()
         
         //
     }