Browse Source

【转换】页面范围选中当前页面,预览图应与视图中的页面对应(已修复)

tangchao 1 year ago
parent
commit
43d64af041

+ 2 - 0
PDF Office/PDF Master/Class/PDFTools/Convert/Controller/KMConvertBaseWindowController.swift

@@ -84,6 +84,8 @@ class KMConvertBaseWindowController: KMBaseWindowController {
             let number: Int = Int((self.prePDFView?.document.pageCount)!)
             let string = "\(number)"
             totalNumberLabel.stringValue = string
+            
+            self.prePDFView?.go(toPageIndex: self.documentModel!.currentIndex, animated: false)
         }
         if (self.prePDFView?.documentView() != nil) {
             self.prePDFView?.documentView().enclosingScrollView?.hasVerticalScroller = false

+ 1 - 0
PDF Office/PDF Master/Class/PDFTools/Convert/Model/KMDocumentModel.swift

@@ -58,6 +58,7 @@ class KMDocumentModel: NSObject {
             return (self.document?.password)!
         }
     }
+    var currentIndex: Int = 0
     
     convenience init(url: URL) {
         self.init()

+ 1 - 1
PDF Office/PDF Master/Class/PDFWindowController/ViewController/KMMainViewController+Action.swift

@@ -1668,7 +1668,7 @@ extension KMMainViewController {
         if (self.listView.document.password != nil) {
             let _ = model.unlock(self.listView.document.password)
         }
-        
+        model.currentIndex = self.listView.currentPageIndex
         windowController?.documentModel = model
         
         windowController?.itemClick = { [weak self] index in