Sfoglia il codice sorgente

【综合】Word转PDF功能调式

tangchao 6 mesi fa
parent
commit
8ade83d34a

+ 3 - 3
PDF Office/PDF Master/Class/Home/ViewController/KMHomeViewController+Action.swift

@@ -635,9 +635,9 @@ extension KMHomeViewController {
             try?FileManager.default.createDirectory(atPath: savePath!.deletingLastPathComponent as String, withIntermediateDirectories: true, attributes: nil)
         }
         
-//        if (!FileManager.default.fileExists(atPath: savePath! as String)) {
-//            FileManager.default.createFile(atPath: savePath! as String, contents: nil)
-//        }
+        if (!FileManager.default.fileExists(atPath: savePath! as String)) {
+            FileManager.default.createFile(atPath: savePath! as String, contents: nil)
+        }
 
         if savePath == nil {
             return

+ 5 - 5
PDF Office/PDF Master/Class/PDFTools/Convert/NewController/Common/KMConvertPDFManager.swift

@@ -180,12 +180,12 @@ class KMConvertPDFManager: NSObject {
             convertString.append("if not isRun then quit\n")
             convertString.append("end tell\n")
 
-//            let dic: AutoreleasingUnsafeMutablePointer<NSDictionary?>? = nil
-//            let docScript = NSAppleScript(source: convertString)
-//            docScript?.executeAndReturnError(dic)
-            let dic = KMOCTool.convertOfficeFile(toPdf: convertString)
+            var dic: NSDictionary?
+            let docScript = NSAppleScript(source: convertString)
+            docScript?.executeAndReturnError(&dic)
+//            let dic = KMOCTool.convertOfficeFile(toPdf: convertString)
             DispatchQueue.main.async {
-                completionHandler(true, dic as NSDictionary)
+                completionHandler(true, dic)
             }
         }
     }