|
@@ -19,11 +19,7 @@ class KMBatchAddHeaderFooterOperation: KMBatchOperation{
|
|
|
init(file: KMBatchOperateFile, headerFooter: KMHeaderFooterModel) {
|
|
|
super.init(file: file)
|
|
|
self.headerFooter = headerFooter
|
|
|
- self.pdfDocument = CPDFDocument(url: URL(fileURLWithPath: file.filePath))
|
|
|
- self.password = file.password
|
|
|
- if ((self.pdfDocument?.isLocked) != nil) {
|
|
|
- self.pdfDocument?.unlock(withPassword: file.password)
|
|
|
- }
|
|
|
+
|
|
|
}
|
|
|
func currentParameter() -> KMBatchBaseParameter {
|
|
|
if headerFooter!.isBates{
|
|
@@ -32,6 +28,11 @@ class KMBatchAddHeaderFooterOperation: KMBatchOperation{
|
|
|
return operateFile!.addHeaderFooterInfo
|
|
|
}
|
|
|
override func start() {
|
|
|
+ self.pdfDocument = CPDFDocument(url: URL(fileURLWithPath: self.operateFile?.filePath ?? ""))
|
|
|
+ self.password = self.operateFile?.password
|
|
|
+ if let data = self.pdfDocument?.isLocked, data {
|
|
|
+ self.pdfDocument?.unlock(withPassword: self.operateFile?.password)
|
|
|
+ }
|
|
|
if !self.isCancelled {
|
|
|
self.delegate?.fileBeginOperate?(self.operateFile!, info: self.currentParameter())
|
|
|
willChangeValue(forKey: "isExecuting")
|