Kaynağa Gözat

【打印机】页面方向选项添加

lizhe 1 yıl önce
ebeveyn
işleme
7f1b26e607

+ 12 - 10
PDF Office/PDF Master/Class/PDFTools/Print/KMPrintWindowController.swift

@@ -222,20 +222,22 @@ class KMPrintWindowController: NSWindowController, NetServiceBrowserDelegate {
         if document != nil {
             if inputDocument != nil {
                 document?.unlock(withPassword: password)
-                if (inputDocument!.allowsPrinting == false) {
-                    KMPasswordInputWindow.openWindow(window: NSApp.mainWindow!, type: .owner, url: (inputDocument!.documentURL)!) { result , password in
-                        if (result == .cancel) {
-                            return
-                        }
-                        
-                        document!.unlock(withPassword: password!)
-                        KMPrintWindowController.openPrintView(document: document)
+            }
+            
+            if (inputDocument!.allowsPrinting == false) {
+                KMPasswordInputWindow.openWindow(window: NSApp.mainWindow!, type: .owner, url: (inputDocument!.documentURL)!) { result , password in
+                    if (result == .cancel) {
+                        return
                     }
-                    return
+                    
+                    document!.unlock(withPassword: password!)
+                    KMPrintWindowController.openPrintView(document: document)
                 }
+                return
             } else {
                 KMPrintWindowController.openPrintView(document: document)
             }
+            
         }
     }
     
@@ -249,7 +251,7 @@ class KMPrintWindowController: NSWindowController, NetServiceBrowserDelegate {
                 printOperation = document!.printOperation(for: printInfo, scalingMode: scalingMode, autoRotate: false)!
             }
             
-            printOperation.printPanel.options = [.showsPreview, .showsCopies, .showsPageRange, .showsPaperSize, .showsCopies, .showsPrintSelection, .showsScaling]
+            printOperation.printPanel.options = [.showsPreview, .showsCopies, .showsOrientation, .showsPageRange, .showsPaperSize, .showsCopies, .showsPrintSelection, .showsScaling]
             let controller = KMPrintAccessoryController_OC(nibName: "KMPrintAccessoryController_OC", bundle: nil)
             printOperation.printPanel.addAccessoryController(controller)