فهرست منبع

标记密文-新增应用功能

tangchao 2 سال پیش
والد
کامیت
5e264d3072

+ 16 - 0
PDF Office/PDF Office.xcodeproj/project.pbxproj

@@ -1138,6 +1138,12 @@
 		BB246DA428F6B492005E8F52 /* NSBezierPath_SKExtensions.m in Sources */ = {isa = PBXBuildFile; fileRef = BB246DA328F6B492005E8F52 /* NSBezierPath_SKExtensions.m */; };
 		BB246DA528F6B492005E8F52 /* NSBezierPath_SKExtensions.m in Sources */ = {isa = PBXBuildFile; fileRef = BB246DA328F6B492005E8F52 /* NSBezierPath_SKExtensions.m */; };
 		BB246DA628F6B492005E8F52 /* NSBezierPath_SKExtensions.m in Sources */ = {isa = PBXBuildFile; fileRef = BB246DA328F6B492005E8F52 /* NSBezierPath_SKExtensions.m */; };
+		BB24D4A72977BE6700041659 /* KMRedactConfirmWindowController.swift in Sources */ = {isa = PBXBuildFile; fileRef = BB24D4A52977BE6700041659 /* KMRedactConfirmWindowController.swift */; };
+		BB24D4A82977BE6700041659 /* KMRedactConfirmWindowController.swift in Sources */ = {isa = PBXBuildFile; fileRef = BB24D4A52977BE6700041659 /* KMRedactConfirmWindowController.swift */; };
+		BB24D4A92977BE6700041659 /* KMRedactConfirmWindowController.swift in Sources */ = {isa = PBXBuildFile; fileRef = BB24D4A52977BE6700041659 /* KMRedactConfirmWindowController.swift */; };
+		BB24D4AA2977BE6700041659 /* KMRedactConfirmWindowController.xib in Resources */ = {isa = PBXBuildFile; fileRef = BB24D4A62977BE6700041659 /* KMRedactConfirmWindowController.xib */; };
+		BB24D4AB2977BE6700041659 /* KMRedactConfirmWindowController.xib in Resources */ = {isa = PBXBuildFile; fileRef = BB24D4A62977BE6700041659 /* KMRedactConfirmWindowController.xib */; };
+		BB24D4AC2977BE6700041659 /* KMRedactConfirmWindowController.xib in Resources */ = {isa = PBXBuildFile; fileRef = BB24D4A62977BE6700041659 /* KMRedactConfirmWindowController.xib */; };
 		BB2C6AC928F4085200478A33 /* CPDFListView.m in Sources */ = {isa = PBXBuildFile; fileRef = BB2C6AC828F4085200478A33 /* CPDFListView.m */; };
 		BB2C6ACB28F40AE800478A33 /* ComPDFKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BB2C6A7828F26A1500478A33 /* ComPDFKit.framework */; };
 		BB2C6ACC28F40AE800478A33 /* ComPDFKit.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = BB2C6A7828F26A1500478A33 /* ComPDFKit.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
@@ -2467,6 +2473,8 @@
 		BB1EC8102967EB5A00EC0BC3 /* KMPageEditThumbnailView_OC.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = KMPageEditThumbnailView_OC.h; sourceTree = "<group>"; };
 		BB246DA228F6B492005E8F52 /* NSBezierPath_SKExtensions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NSBezierPath_SKExtensions.h; sourceTree = "<group>"; };
 		BB246DA328F6B492005E8F52 /* NSBezierPath_SKExtensions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NSBezierPath_SKExtensions.m; sourceTree = "<group>"; };
+		BB24D4A52977BE6700041659 /* KMRedactConfirmWindowController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KMRedactConfirmWindowController.swift; sourceTree = "<group>"; };
+		BB24D4A62977BE6700041659 /* KMRedactConfirmWindowController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = KMRedactConfirmWindowController.xib; sourceTree = "<group>"; };
 		BB2C6A7828F26A1500478A33 /* ComPDFKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = ComPDFKit.framework; sourceTree = "<group>"; };
 		BB2C6A7C28F26CEF00478A33 /* PDF Office-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "PDF Office-Bridging-Header.h"; sourceTree = "<group>"; };
 		BB2C6A7D28F26CEF00478A33 /* PDF Office Pro-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "PDF Office Pro-Bridging-Header.h"; sourceTree = "<group>"; };
@@ -4415,6 +4423,8 @@
 			isa = PBXGroup;
 			children = (
 				BB4EEF3329764166003A3537 /* KMRedactPropertyWindowController.swift */,
+				BB24D4A52977BE6700041659 /* KMRedactConfirmWindowController.swift */,
+				BB24D4A62977BE6700041659 /* KMRedactConfirmWindowController.xib */,
 			);
 			path = Window;
 			sourceTree = "<group>";
@@ -5565,6 +5575,7 @@
 				9FBA0EE428FEC253001117AF /* KMProductPromotionViewController.xib in Resources */,
 				BBEC00C2295C306400A26C98 /* KMBatesPropertyController.xib in Resources */,
 				BBD1F77F296F9BE000343885 /* KMPageEditSettingBaseWindowController.xib in Resources */,
+				BB24D4AA2977BE6700041659 /* KMRedactConfirmWindowController.xib in Resources */,
 				F3A9DC81294309D80074E5D2 /* CPDFListEditAnnotationViewController.xib in Resources */,
 				89E4E7852967BF5A002DBA6F /* KMCustomizeStampViewController.xib in Resources */,
 				F359917B292B7B8A000D25DE /* InitialUserDefaults.plist in Resources */,
@@ -5843,6 +5854,7 @@
 				ADCB98E62924777A00B51A03 /* KMBatchProcessingSizeTableCell.xib in Resources */,
 				ADCB98FE292750A200B51A03 /* KMBatchProcessingTableView.xib in Resources */,
 				BBC2BCCA295DA8F30036B983 /* KMCropPreviewController.xib in Resources */,
+				BB24D4AB2977BE6700041659 /* KMRedactConfirmWindowController.xib in Resources */,
 				BB1EC8022967B26700EC0BC3 /* KMPDFEditViewController.xib in Resources */,
 				ADCB98EE2924779800B51A03 /* KMBatchProcessingStateTableCell.xib in Resources */,
 				89E4E7392964148E002DBA6F /* KMAnnotationPropertiesViewController.xib in Resources */,
@@ -6054,6 +6066,7 @@
 				8942F7FD2926089200389627 /* KMSignatureViewController.xib in Resources */,
 				BBC3481129558DC1008D2CD1 /* KMBackgroundController.xib in Resources */,
 				89316827296D73CC0073EA59 /* KMSignatureAnnotationViewController.xib in Resources */,
+				BB24D4AC2977BE6700041659 /* KMRedactConfirmWindowController.xib in Resources */,
 				BB8B17382907B64D001C5EA5 /* CipherTextView.xib in Resources */,
 				8931684E296E436B0073EA59 /* KMSignatureWindowController.xib in Resources */,
 				89316857296E45CA0073EA59 /* KMImageAccessoryController.xib in Resources */,
@@ -6558,6 +6571,7 @@
 				BBFE6E65293097A600142C01 /* KMPageRangePickerWindowController.swift in Sources */,
 				BB2EDF4C296E63E5003BCF58 /* KMPageEditInsertCustomPageWindowController.swift in Sources */,
 				BB4EEF382976451E003A3537 /* KMRedactContentBaseView.swift in Sources */,
+				BB24D4A72977BE6700041659 /* KMRedactConfirmWindowController.swift in Sources */,
 				8997010E28F40842009AF911 /* KMOutlineViewController.swift in Sources */,
 				BB2F61502966A91D001CB369 /* KMBackgroundPropertyHomeController.swift in Sources */,
 				9F1FE3DE293EE51F00E952CA /* KMMainDocument.swift in Sources */,
@@ -7036,6 +7050,7 @@
 				8942F80F29277BAF00389627 /* NSMenu+Category.m in Sources */,
 				BB2EDF4D296E63E5003BCF58 /* KMPageEditInsertCustomPageWindowController.swift in Sources */,
 				BB4EEF392976451E003A3537 /* KMRedactContentBaseView.swift in Sources */,
+				BB24D4A82977BE6700041659 /* KMRedactConfirmWindowController.swift in Sources */,
 				8997010F28F40842009AF911 /* KMOutlineViewController.swift in Sources */,
 				BB2F61512966A91D001CB369 /* KMBackgroundPropertyHomeController.swift in Sources */,
 				9F1FE3DF293EE51F00E952CA /* KMMainDocument.swift in Sources */,
@@ -7475,6 +7490,7 @@
 				AD4B454A293ED7DA0076FA14 /* KMImageToPDFManager.swift in Sources */,
 				F344A3B6293094DB003A4383 /* CPDFListSignatureAnnotation.m in Sources */,
 				BB4EEF4229764FCC003A3537 /* KMWatermarkColorView.swift in Sources */,
+				BB24D4A92977BE6700041659 /* KMRedactConfirmWindowController.swift in Sources */,
 				AD4B455829408CB00076FA14 /* KMOCRChooseView.swift in Sources */,
 				BB5DF1F32959C9F00025CDA1 /* KMHeaderFooterController.swift in Sources */,
 				9F8DDF2829237910006CDC73 /* Array+KMExtensions.swift in Sources */,

BIN
PDF Office/PDF Office.xcodeproj/project.xcworkspace/xcuserdata/kdanmobile.xcuserdatad/UserInterfaceState.xcuserstate


+ 101 - 0
PDF Office/PDF Office/Class/PDFTools/Redact/Window/KMRedactConfirmWindowController.swift

@@ -0,0 +1,101 @@
+//
+//  KMRedactConfirmWindowController.swift
+//  PDF Office
+//
+//  Created by tangchao on 2023/1/18.
+//
+
+import Cocoa
+enum KMRedactConfirmType {
+case redactOne
+case eraserOne
+case redactAll
+case eraserAll
+}
+
+typealias KMRedactConfirmItemClick = (_ index: Int) -> ()
+class KMRedactConfirmWindowController: NSWindowController {
+
+    @IBOutlet weak var titleLabel: NSTextField!
+    @IBOutlet weak var subTitleLabel: NSTextField!
+    @IBOutlet weak var despLabel: NSTextField!
+    @IBOutlet weak var funcButton: NSButton!
+    @IBOutlet weak var cancelButton: NSButton!
+    
+    private var myType: KMRedactConfirmType = .redactOne
+    var type: KMRedactConfirmType {
+        get {
+            return myType
+        }
+        set {
+            myType = newValue
+        }
+    }
+    
+    var itemClick: KMRedactConfirmItemClick!
+    
+    convenience init(_ type: KMRedactConfirmType) {
+        self.init(windowNibName: "KMRedactConfirmWindowController")
+        
+        self.type = type
+    }
+    
+    override func windowDidLoad() {
+        super.windowDidLoad()
+
+        self.titleLabel.font = NSFont.boldSystemFont(ofSize: 16)
+        self.subTitleLabel.textColor = NSColor(white: 0, alpha: 0.6)
+        self.despLabel.stringValue = "此操作将从本文档中永久删除已标记密文的信息,您将无法检索已标记密文的信息。"
+        
+        cancelButton.title = NSLocalizedString("取消", comment: "")
+        cancelButton.isBordered = false
+        cancelButton.wantsLayer = true
+        cancelButton.layer?.borderWidth = 1
+        cancelButton.layer?.borderColor = NSColor.black.cgColor
+        cancelButton.layer?.cornerRadius = 4
+        cancelButton.target = self
+        cancelButton.action = #selector(cancelButtonAction)
+        
+        funcButton.isBordered = false
+        funcButton.wantsLayer = true
+        funcButton.layer?.cornerRadius = 4
+        funcButton.target = self
+        self.funcButton.layer?.backgroundColor = NSColor.black.cgColor
+        funcButton.action = #selector(funcButtonAction)
+        
+        if (self.type == .redactOne) {
+            self.titleLabel.stringValue = "应用标记密文"
+        } else if (self.type == .eraserOne) {
+            self.titleLabel.stringValue = "擦除标记密文"
+        } else if (self.type == .redactAll) {
+            self.titleLabel.stringValue = "应用所有标记密文"
+        } else if (self.type == .eraserAll) {
+            self.titleLabel.stringValue = "擦除所有标记密文"
+        }
+        
+        if (self.type == .redactOne || self.type == .redactAll) {
+            self.subTitleLabel.stringValue = "使用色块替换选定敏感内容"
+            self.funcButton.title = NSLocalizedString("应用并另存文档", comment: "")
+            self.funcButton.attributedTitle = NSMutableAttributedString(string: self.funcButton.title, attributes: [NSAttributedString.Key.foregroundColor : NSColor.white])
+        }
+        if (self.type == .eraserOne || self.type == .eraserAll) {
+            self.subTitleLabel.stringValue = "使用空白区块移除选定敏感内容"
+            self.funcButton.title = NSLocalizedString("擦除并另存文档", comment: "")
+            self.funcButton.attributedTitle = NSMutableAttributedString(string: self.funcButton.title, attributes: [NSAttributedString.Key.foregroundColor : NSColor.white])
+        }
+    }
+    
+    @objc private func cancelButtonAction() {
+        guard let callback = self.itemClick else {
+            return
+        }
+        callback(2)
+    }
+    
+    @objc private func funcButtonAction() {
+        guard let callback = self.itemClick else {
+            return
+        }
+        callback(1)
+    }
+}

+ 109 - 0
PDF Office/PDF Office/Class/PDFTools/Redact/Window/KMRedactConfirmWindowController.xib

@@ -0,0 +1,109 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="21225" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
+    <dependencies>
+        <deployment identifier="macosx"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="21225"/>
+        <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
+    </dependencies>
+    <objects>
+        <customObject id="-2" userLabel="File's Owner" customClass="KMRedactConfirmWindowController" customModule="PDF_Office" customModuleProvider="target">
+            <connections>
+                <outlet property="cancelButton" destination="AGc-Gn-jng" id="bb5-Aa-sgK"/>
+                <outlet property="despLabel" destination="a3R-5a-vlS" id="tLm-Eg-qim"/>
+                <outlet property="funcButton" destination="ge7-VW-qn9" id="vSx-nR-GCX"/>
+                <outlet property="subTitleLabel" destination="IAA-8D-eit" id="5fO-dV-iBj"/>
+                <outlet property="titleLabel" destination="LvF-Uh-de3" id="C6O-mw-f7g"/>
+                <outlet property="window" destination="F0z-JX-Cv5" id="gIp-Ho-8D9"/>
+            </connections>
+        </customObject>
+        <customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>
+        <customObject id="-3" userLabel="Application" customClass="NSObject"/>
+        <window title="Window" allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" releasedWhenClosed="NO" animationBehavior="default" id="F0z-JX-Cv5">
+            <windowStyleMask key="styleMask" titled="YES" closable="YES" miniaturizable="YES" resizable="YES"/>
+            <windowPositionMask key="initialPositionMask" leftStrut="YES" rightStrut="YES" topStrut="YES" bottomStrut="YES"/>
+            <rect key="contentRect" x="196" y="240" width="358" height="246"/>
+            <rect key="screenRect" x="0.0" y="0.0" width="1440" height="875"/>
+            <value key="minSize" type="size" width="358" height="246"/>
+            <value key="maxSize" type="size" width="358" height="246"/>
+            <value key="minFullScreenContentSize" type="size" width="358" height="246"/>
+            <value key="maxFullScreenContentSize" type="size" width="358" height="246"/>
+            <view key="contentView" id="se5-gp-TjO">
+                <rect key="frame" x="0.0" y="0.0" width="358" height="246"/>
+                <autoresizingMask key="autoresizingMask"/>
+                <subviews>
+                    <textField verticalHuggingPriority="750" horizontalCompressionResistancePriority="250" translatesAutoresizingMaskIntoConstraints="NO" id="LvF-Uh-de3">
+                        <rect key="frame" x="20" y="210" width="318" height="16"/>
+                        <constraints>
+                            <constraint firstAttribute="width" constant="314" id="PBn-nj-2cA"/>
+                        </constraints>
+                        <textFieldCell key="cell" selectable="YES" alignment="center" title="Multiline Label" id="pWU-6U-9BV">
+                            <font key="font" usesAppearanceFont="YES"/>
+                            <color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
+                            <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
+                        </textFieldCell>
+                    </textField>
+                    <textField verticalHuggingPriority="750" horizontalCompressionResistancePriority="250" translatesAutoresizingMaskIntoConstraints="NO" id="IAA-8D-eit">
+                        <rect key="frame" x="20" y="188" width="318" height="16"/>
+                        <constraints>
+                            <constraint firstAttribute="width" constant="314" id="8bB-Ig-Mqf"/>
+                        </constraints>
+                        <textFieldCell key="cell" selectable="YES" alignment="center" title="Multiline Label" id="QbL-30-qtl">
+                            <font key="font" metaFont="system"/>
+                            <color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
+                            <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
+                        </textFieldCell>
+                    </textField>
+                    <textField verticalHuggingPriority="750" horizontalCompressionResistancePriority="250" translatesAutoresizingMaskIntoConstraints="NO" id="a3R-5a-vlS">
+                        <rect key="frame" x="20" y="158" width="318" height="16"/>
+                        <constraints>
+                            <constraint firstAttribute="width" constant="314" id="bJW-Tt-5ZP"/>
+                        </constraints>
+                        <textFieldCell key="cell" selectable="YES" alignment="center" title="Multiline Label" id="L56-ZW-w2l">
+                            <font key="font" metaFont="system"/>
+                            <color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
+                            <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
+                        </textFieldCell>
+                    </textField>
+                    <button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="ge7-VW-qn9">
+                        <rect key="frame" x="96" y="64" width="166" height="32"/>
+                        <constraints>
+                            <constraint firstAttribute="width" constant="166" id="Ll3-M3-Z6v"/>
+                            <constraint firstAttribute="height" constant="32" id="hJA-nr-mn2"/>
+                        </constraints>
+                        <buttonCell key="cell" type="bevel" title="Button" bezelStyle="rounded" alignment="center" imageScaling="proportionallyDown" inset="2" id="gBt-gC-XuC">
+                            <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
+                            <font key="font" metaFont="system"/>
+                        </buttonCell>
+                    </button>
+                    <button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="AGc-Gn-jng">
+                        <rect key="frame" x="96" y="24" width="166" height="32"/>
+                        <constraints>
+                            <constraint firstAttribute="width" constant="166" id="MjK-37-7ph"/>
+                            <constraint firstAttribute="height" constant="32" id="xS3-ZO-aGc"/>
+                        </constraints>
+                        <buttonCell key="cell" type="bevel" title="Button" bezelStyle="rounded" alignment="center" imageScaling="proportionallyDown" inset="2" id="Ng6-BX-Rd0">
+                            <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
+                            <font key="font" metaFont="system"/>
+                        </buttonCell>
+                    </button>
+                </subviews>
+                <constraints>
+                    <constraint firstItem="ge7-VW-qn9" firstAttribute="centerX" secondItem="se5-gp-TjO" secondAttribute="centerX" id="4f3-wR-fqr"/>
+                    <constraint firstItem="AGc-Gn-jng" firstAttribute="top" secondItem="ge7-VW-qn9" secondAttribute="bottom" constant="8" id="8tw-eE-Rl9"/>
+                    <constraint firstItem="LvF-Uh-de3" firstAttribute="centerX" secondItem="se5-gp-TjO" secondAttribute="centerX" id="AVf-uZ-kk9"/>
+                    <constraint firstItem="a3R-5a-vlS" firstAttribute="top" secondItem="IAA-8D-eit" secondAttribute="bottom" constant="14" id="Arm-6y-4Ej"/>
+                    <constraint firstAttribute="bottom" secondItem="AGc-Gn-jng" secondAttribute="bottom" constant="24" id="B2o-LN-ael"/>
+                    <constraint firstItem="AGc-Gn-jng" firstAttribute="centerX" secondItem="se5-gp-TjO" secondAttribute="centerX" id="ETK-Oj-QAI"/>
+                    <constraint firstItem="IAA-8D-eit" firstAttribute="top" secondItem="LvF-Uh-de3" secondAttribute="bottom" constant="6" id="G2G-7y-mBo"/>
+                    <constraint firstItem="IAA-8D-eit" firstAttribute="centerX" secondItem="se5-gp-TjO" secondAttribute="centerX" id="WUx-Vm-W2c"/>
+                    <constraint firstItem="a3R-5a-vlS" firstAttribute="centerX" secondItem="se5-gp-TjO" secondAttribute="centerX" id="enD-rO-Zgf"/>
+                    <constraint firstItem="LvF-Uh-de3" firstAttribute="top" secondItem="se5-gp-TjO" secondAttribute="top" constant="20" symbolic="YES" id="ui0-eh-g49"/>
+                </constraints>
+            </view>
+            <connections>
+                <outlet property="delegate" destination="-2" id="0bl-1N-AYu"/>
+            </connections>
+            <point key="canvasLocation" x="-10" y="144"/>
+        </window>
+    </objects>
+</document>

+ 41 - 0
PDF Office/PDF Office/Class/PDFWindowController/ViewController/KMMainViewController+Action.swift

@@ -512,6 +512,47 @@ extension KMMainViewController {
     }
     
     @objc func redact_menuItemClick_apply(sender: NSMenuItem?) {
+        let anno = self.listView.activeAnnotation
+        if (anno == nil || (anno?.isKind(of: CPDFRedactAnnotation.self)) == false) {
+            return
+        }
+        
+        let windowController = KMRedactConfirmWindowController(.redactOne)
+        self.currentWindowController = windowController
+        self.view.window?.beginSheet(windowController.window!)
+        windowController.itemClick = { [weak self] index in
+            if (index == 2) { /// 取消
+                self?.view.window?.endSheet((self?.currentWindowController.window)!)
+                self?.currentWindowController = nil
+                return
+            }
+            
+            self?.view.window?.endSheet((self?.currentWindowController.window)!)
+            self?.currentWindowController = nil
+            
+            let panel = NSSavePanel()
+            panel.nameFieldStringValue = "[新文件]"+(self?.listView.document.documentURL.lastPathComponent)!
+            let button = NSButton.init(checkboxWithTitle: "保存后打开文档", target: nil, action: nil)
+            button.state = .on
+            panel.accessoryView = button
+            panel.isExtensionHidden = true
+            panel.beginSheetModal(for: (self?.view.window!)!) { response in
+                if response != .OK {
+                    return
+                }
+                
+                (anno as! CPDFRedactAnnotation).applyRedaction()
+                self!.listView.document.write(to: panel.url)
+                
+                if (button.state == .on) {
+                    NSDocumentController.shared.openDocument(withContentsOf: panel.url!, display: true) { document, alreadyOpen, error in
+                        
+                    }
+                } else {
+                    NSWorkspace.shared.activateFileViewerSelecting([panel.url!])
+                }
+            }
+        }
         
     }