Sfoglia il codice sorgente

ierge branch 'develop_PDFReaderProNew' of git.kdan.cc:Mac_PDF/PDF_Office into develop_PDFReaderProNew

tangchao 1 anno fa
parent
commit
a98d600578

+ 4 - 4
PDF Office/PDF Master/Class/PDFTools/Background/New/View/KMAddBackgroundView.swift

@@ -752,8 +752,8 @@ extension KMAddBackgroundView {
         if pdfView.canGoToPreviousPage() {
             pdfView.goToPreviousPage(nil)
         }
-        let index = pdfDocument!.index(for: pdfView.currentPage())
-        currentPageIndexTextField.stringValue = "\(index + 1)"
+//        let index = pdfDocument!.index(for: pdfView.currentPage())
+//        currentPageIndexTextField.stringValue = "\(index + 1)"
     }
 
     @IBAction func goNext(_ sender: Any) {
@@ -761,8 +761,8 @@ extension KMAddBackgroundView {
             pdfView.goToNextPage(nil)
         }
 
-        let index = pdfDocument!.index(for: pdfView.currentPage())
-        currentPageIndexTextField.stringValue = "\(index + 1)"
+//        let index = pdfDocument!.index(for: pdfView.currentPage())
+//        currentPageIndexTextField.stringValue = "\(index + 1)"
     }
 
     @IBAction func buttonClicked_BrowserFile(_ sender: Any) {

+ 5 - 2
PDF Office/PDF Master/Class/PDFTools/Watermark/New/View/KMWatermarkView.swift

@@ -351,6 +351,9 @@ class KMWatermarkView: KMBaseXibView, NSTextFieldDelegate, NSComboBoxDelegate, N
         checkAngle()
     }
     
+    override func addNotification() {
+        NotificationCenter.default.addObserver(self, selector: #selector(pageChangeNotification), name: NSNotification.Name.CPDFViewPageChanged, object: self.pdfView)
+    }
     func updatePDFView() {
         //        pdfView.needsDisplay = true
         self.pdfView.setNeedsDisplayForVisiblePages()
@@ -937,7 +940,7 @@ extension KMWatermarkView {
             pdfView.goToPreviousPage(sender)
         }
         let index = pdfDocument?.index(for: pdfView.currentPage())
-        currentPageIndexTextF.stringValue = "\(index! + 1)"
+//        currentPageIndexTextF.stringValue = "\(index! + 1)"
     }
     
     @IBAction func goNext(_ sender: Any) {
@@ -946,7 +949,7 @@ extension KMWatermarkView {
         }
         
         let index = pdfDocument!.index(for: pdfView.currentPage())
-        currentPageIndexTextF.stringValue = "\(index + 1)"
+//        currentPageIndexTextF.stringValue = "\(index + 1)"
     }
     
     @IBAction func fontSizeComboxAction(_ sender: NSComboBox) {