|
@@ -198,6 +198,7 @@ class SplitWindowController: NSWindowController {
|
|
|
}
|
|
|
}
|
|
|
fileAttribute?.pagesString = tPagesString
|
|
|
+ fileAttribute?.pagesType = .odd
|
|
|
} else if self.pageRangeComboBox.stringValue == KMLocalizedString("Even Pages Only", nil) {
|
|
|
var tPagesString = ""
|
|
|
for i in 0 ..< self._PDFDocument!.pageCount {
|
|
@@ -210,8 +211,10 @@ class SplitWindowController: NSWindowController {
|
|
|
}
|
|
|
}
|
|
|
fileAttribute?.pagesString = tPagesString
|
|
|
+ fileAttribute?.pagesType = .even
|
|
|
} else {
|
|
|
fileAttribute?.pagesString = self.pageRangeComboBox.stringValue
|
|
|
+ fileAttribute?.pagesType = .custom
|
|
|
}
|
|
|
if let data = fileAttribute?.fetchSelectPages().isEmpty, data {
|
|
|
KMAlertTool.runModelForMainThread(message: KMLocalizedString("Invalid page range or the page number is out of range. Please try again.", nil))
|
|
@@ -280,7 +283,8 @@ class SplitWindowController: NSWindowController {
|
|
|
} else if (self.byFileButton.state == .on) {
|
|
|
let dex = self.byFileStepper.integerValue
|
|
|
DispatchQueue.global().async {
|
|
|
- let successArray = self._PDFDocument?.splitByPagesWith(dex, folerPath: tFolderPath, fileName: folderName)
|
|
|
+// let successArray = self._PDFDocument?.splitByPagesWith(dex, folerPath: tFolderPath, fileName: folderName)
|
|
|
+ let successArray = self._PDFDocument?.splitByFileWith(dex, folerPath: tFolderPath, fileName: folderName)
|
|
|
DispatchQueue.main.async {
|
|
|
self.progress.isHidden = true
|
|
|
self.cancelButton.isEnabled = true
|
|
@@ -324,11 +328,11 @@ class SplitWindowController: NSWindowController {
|
|
|
}
|
|
|
}
|
|
|
if (pdfDocument1!.pageCount > 0) {
|
|
|
- let tpath = "\(tFolderPath)\\\(folderName) 1.pdf"
|
|
|
+ let tpath = "\(tFolderPath)/\(folderName) 1.pdf"
|
|
|
_isSuccessfully = pdfDocument1?.write(toFile:tpath) ?? false
|
|
|
}
|
|
|
if (pdfDocument2!.pageCount > 0) {
|
|
|
- let tPath = "\(tFolderPath)\\\(folderName) 2.pdf"
|
|
|
+ let tPath = "\(tFolderPath)/\(folderName) 2.pdf"
|
|
|
pdfDocument2?.write(toFile: tPath)
|
|
|
}
|
|
|
DispatchQueue.main.async {
|
|
@@ -344,7 +348,7 @@ class SplitWindowController: NSWindowController {
|
|
|
if (response == .alertFirstButtonReturn) {
|
|
|
self.km_quick_endSheet()
|
|
|
DispatchQueue.main.asyncAfter(deadline: .now()+0.5) {
|
|
|
- let filePath = "\(tFolderPath)\\\(folderName) 1.pdf"
|
|
|
+ let filePath = "\(tFolderPath)/\(folderName) 1.pdf"
|
|
|
self._viewFileAtFinder(filePath)
|
|
|
}
|
|
|
}
|