Browse Source

[编辑工具] - 管理模版,预览文件

liujiajie 1 year ago
parent
commit
6e3bdaacc6

+ 6 - 0
PDF Office/PDF Master/Class/PDFTools/AddHeaderFooter/New/View/KMHeaderFooterView.xib

@@ -635,6 +635,7 @@ DQ
                                         <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
                                         <size key="minSize" width="173" height="38"/>
                                         <size key="maxSize" width="296" height="10000000"/>
+                                        <color key="insertionPointColor" name="textInsertionPointColor" catalog="System" colorSpace="catalog"/>
                                     </textView>
                                 </subviews>
                             </clipView>
@@ -663,6 +664,7 @@ DQ
                                         <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
                                         <size key="minSize" width="172" height="38"/>
                                         <size key="maxSize" width="295" height="10000000"/>
+                                        <color key="insertionPointColor" name="textInsertionPointColor" catalog="System" colorSpace="catalog"/>
                                     </textView>
                                 </subviews>
                             </clipView>
@@ -688,6 +690,7 @@ DQ
                                         <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
                                         <size key="minSize" width="173" height="38"/>
                                         <size key="maxSize" width="311" height="10000000"/>
+                                        <color key="insertionPointColor" name="textInsertionPointColor" catalog="System" colorSpace="catalog"/>
                                     </textView>
                                 </subviews>
                             </clipView>
@@ -788,6 +791,7 @@ DQ
                                         <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
                                         <size key="minSize" width="173" height="38"/>
                                         <size key="maxSize" width="311" height="10000000"/>
+                                        <color key="insertionPointColor" name="textInsertionPointColor" catalog="System" colorSpace="catalog"/>
                                     </textView>
                                 </subviews>
                             </clipView>
@@ -813,6 +817,7 @@ DQ
                                         <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
                                         <size key="minSize" width="172" height="38"/>
                                         <size key="maxSize" width="310" height="10000000"/>
+                                        <color key="insertionPointColor" name="textInsertionPointColor" catalog="System" colorSpace="catalog"/>
                                     </textView>
                                 </subviews>
                             </clipView>
@@ -838,6 +843,7 @@ DQ
                                         <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
                                         <size key="minSize" width="173" height="38"/>
                                         <size key="maxSize" width="311" height="10000000"/>
+                                        <color key="insertionPointColor" name="textInsertionPointColor" catalog="System" colorSpace="catalog"/>
                                     </textView>
                                 </subviews>
                             </clipView>

+ 5 - 1
PDF Office/PDF Master/Class/PDFTools/AddHeaderFooter/VC/KMBatchOperateAddHeaderFooterViewController.swift

@@ -513,7 +513,11 @@ class KMBatchOperateAddHeaderFooterViewController: KMBatchOperateBaseViewControl
 //        }
 //        wc?.beginSheetModalForWindow(NSApp.keyWindow, completionHandler: nil)
         
-        let filePath: String = Bundle.main.path(forResource: "PDF Master User Guide", ofType: "pdf") ?? ""
+        var filePath: String = Bundle.main.path(forResource: "PDF Master User Guide", ofType: "pdf") ?? ""
+        if self.pdfView?.document.documentURL.path.count ?? 0 > 0 {
+            filePath = self.pdfView?.document.documentURL.path ?? ""
+        }
+
         let cdocument = CPDFDocument(url: URL(fileURLWithPath: filePath))
         
         let windowController = KMHeaderFooterWindowController(windowNibName: "KMHeaderFooterWindowController")

+ 6 - 1
PDF Office/PDF Master/Class/PDFTools/Watermark/Controller/KMBatchOperateAddWatermarkViewController.swift

@@ -648,7 +648,9 @@ extension KMBatchOperateAddWatermarkViewController {
     }
     func editBackground(_ background: KMBackgroundModel) {
         var filePath: String = Bundle.main.path(forResource: "PDF Master User Guide", ofType: "pdf") ?? ""
-    
+        if self.pdfView?.document.documentURL.path.count ?? 0 > 0 {
+            filePath = self.pdfView?.document.documentURL.path ?? ""
+        }
         let cdocument = CPDFDocument(url: URL(fileURLWithPath: filePath))
         
         let controller = KMBackgroundWindowController(windowNibName: "KMBackgroundWindowController")
@@ -695,6 +697,9 @@ extension KMBatchOperateAddWatermarkViewController {
     func editWatermark(_ waterMark: KMWatermarkModel) {
         if !isBackground {
             var filePath: String = Bundle.main.path(forResource: "PDF Master User Guide", ofType: "pdf") ?? ""
+            if self.pdfView?.document.documentURL.path.count ?? 0 > 0 {
+                filePath = self.pdfView?.document.documentURL.path ?? ""
+            }
         
             let cdocument = CPDFDocument(url: URL(fileURLWithPath: filePath))
             let controller = KMWatermarkWindowController(windowNibName: "KMWatermarkWindowController")