Browse Source

【编辑工具】页眉页脚 bates码 保存文件名修改

lizhe 1 year ago
parent
commit
bf4fd7091c

+ 4 - 2
PDF Office/PDF Master/Class/PDFTools/AddHeaderFooter/New/View/KMHeaderFooterView.swift

@@ -256,6 +256,7 @@ class KMHeaderFooterView: KMBaseXibView, NSTextViewDelegate, NSComboBoxDelegate
 
         self.textColorWell.color = self.headerFooterObj.getTextColor()
         self.pdfView.autoScales = true
+        self.pdfView.setDisplay(.singlePage)
 //        self.pdfView.documentView?.enclosingScrollView?.hasVerticalScroller = false
 //        self.pdfView.documentView?.enclosingScrollView?.hasHorizontalScroller = false
 
@@ -746,6 +747,7 @@ class KMHeaderFooterView: KMBaseXibView, NSTextViewDelegate, NSComboBoxDelegate
                     bates.update()
                 }
             } else {
+                print(document?.headerFooter())
                 if let headerFooter = document?.headerFooter() {
                     headerFooter.margin = NSEdgeInsets(top: max(self.headerFooterObj.topMargin - size.height, 0),
                                                        left: self.headerFooterObj.leftMargin,
@@ -1174,9 +1176,9 @@ extension KMHeaderFooterView {
             
             var fileName: String?
             if isBates {
-                fileName = "\(pdfDocument?.documentURL?.lastPathComponent.deletingPathExtension ?? NSLocalizedString("Untitled", comment: ""))_Bates"
+                fileName = "\(pdfDocument?.documentURL?.lastPathComponent ?? NSLocalizedString("Untitled", comment: ""))_Bates"
             } else {
-                fileName = "\(pdfDocument?.documentURL?.lastPathComponent.deletingPathExtension ?? NSLocalizedString("Untitled", comment: ""))_Header_Footer"
+                fileName = "\(pdfDocument?.documentURL?.lastPathComponent ?? NSLocalizedString("Untitled", comment: ""))_Header_Footer"
             }
             
             let savePanelAccessoryViewController = KMSavePanelAccessoryController()