|
@@ -261,14 +261,21 @@ class KMBatchOperateAddWatermarkViewController: KMBatchOperateBaseViewController
|
|
|
self.hiddenWindowCloseButtonIfNeeded()
|
|
|
self.successFilePathURLArray?.removeAll()
|
|
|
if (!self.isBackground) {
|
|
|
- let file = KMBatchOperateFile(filePath: self.pdfView?.document.documentURL.path ?? "")
|
|
|
+ let file = KMBatchOperateFile(filePath: self.pdfView?.document.documentURL.path ?? "", type: .AddWatermark)
|
|
|
file.addWatermarkInfo.savePath = fileURL.path
|
|
|
file.addWatermarkInfo.pageChoice = KMBatchOperatePageChoice(rawValue: watermark?.pageRangeType.rawValue ?? 0) ?? .All
|
|
|
file.addWatermarkInfo.pageRangeString = watermark?.pagesString ?? ""
|
|
|
+ let op = KMBatchAddWatermarkOperation(file: file, waterMarkM: watermark!)
|
|
|
+ op.delegate = self
|
|
|
+ self.queue?.addOperation(op)
|
|
|
} else {
|
|
|
- let file = KMBatchOperateFile(filePath: self.pdfView?.document.documentURL.path ?? "")
|
|
|
+ let file = KMBatchOperateFile(filePath: self.pdfView?.document.documentURL.path ?? "", type: .AddBackground)
|
|
|
file.addBackgroundInfo.savePath = fileURL.path
|
|
|
+ file.addWatermarkInfo.pageChoice = KMBatchOperatePageChoice(rawValue: watermark?.pageRangeType.rawValue ?? 0) ?? .All
|
|
|
file.addBackgroundInfo.pageRangeString = background?.pagesString ?? ""
|
|
|
+ let op = KMBatchAddBackgroundOperation(file: file, backgroundM: background!)
|
|
|
+ op.delegate = self
|
|
|
+ self.queue?.addOperation(op)
|
|
|
}
|
|
|
if let cnt = self.queue?.operations.count, cnt > 0 {
|
|
|
self.interfaceStatus = .Processing
|
|
@@ -625,12 +632,13 @@ extension KMBatchOperateAddWatermarkViewController {
|
|
|
|
|
|
@objc private func _buttonItemClick_addBatch(_ sender: Any?) {
|
|
|
let baseWindowController = KMBatchOperateBaseWindowController(windowNibName: "KMBatchOperateBaseWindowController")
|
|
|
- baseWindowController.window?.makeKeyAndOrderFront(nil)
|
|
|
+
|
|
|
// NSMutableArray *arr = [NSMutableArray array];
|
|
|
|
|
|
-// KMBatchOperateFile *file = [[KMBatchOperateFile alloc] initWithFilePath:self.pdfView.document.documentURL.path type:self.isBackground ? KMBatchOperationTypeAddBackground : KMBatchOperationTypeAddWatermark];
|
|
|
-// [arr addObject:file];
|
|
|
- // [baseWindowController checkNeedPasswordSwitchToOperateType:self.isBackground ? KMBatchOperationTypeAddBackground : KMBatchOperationTypeAddWatermark files:arr];
|
|
|
+ let file = KMBatchOperateFile(filePath: self.pdfView!.document.documentURL.path, type: self.isBackground ? .AddBackground : .AddWatermark)
|
|
|
+
|
|
|
+ baseWindowController.window?.makeKeyAndOrderFront(nil)
|
|
|
+ baseWindowController.checkNeedPasswordSwitchToOperateType(operateType: self.isBackground ? .AddBackground : .AddWatermark, files: [file])
|
|
|
}
|
|
|
|
|
|
@objc private func _buttonItemClick_CleanAll(_ sender: Any?) {
|