|
@@ -274,7 +274,7 @@ class KMPDFConvert: Operation {
|
|
|
return
|
|
|
}
|
|
|
|
|
|
- if self.convertType == .csv{
|
|
|
+ if self.convertType == .csv && isExtractTable{
|
|
|
self.converter = CPDFConverterCsv.init(url: URL(fileURLWithPath: filePath), password: self.password)
|
|
|
self.converter.delegate = self
|
|
|
let options = CPDFConvertCsvOptions()
|
|
@@ -283,47 +283,47 @@ class KMPDFConvert: Operation {
|
|
|
return
|
|
|
}
|
|
|
|
|
|
- if self.convertType == .rtf{
|
|
|
- self.converter = CPDFConverterRtf.init(url: URL(fileURLWithPath: filePath), password: self.password)
|
|
|
- self.converter.delegate = self
|
|
|
- let options = CPDFConvertRtfOptions()
|
|
|
- options.isContainAnnotations = true
|
|
|
- options.isAllowOCR = true
|
|
|
-// if (self.isAllowOCR) {
|
|
|
-// options.isContainOCRBgImage = self.isContainOCRBgImage
|
|
|
-// if let language = self.ocrLanguage {
|
|
|
-// options.language = language
|
|
|
-// } else {
|
|
|
-// options.language = .english
|
|
|
-// }
|
|
|
-// } else {
|
|
|
- options.isContainImages = true
|
|
|
-// options.isContainOCRBgImage = false
|
|
|
-// }
|
|
|
- self.converter.convert(toFilePath: self.outputFilePath, pageIndexs: self.pages, options: options)
|
|
|
- return
|
|
|
- }
|
|
|
-
|
|
|
- if self.convertType == .html{
|
|
|
- self.converter = CPDFConverterHtml.init(url: URL(fileURLWithPath: filePath), password: self.password)
|
|
|
- self.converter.delegate = self
|
|
|
- let options = CPDFConvertHtmlOptions()
|
|
|
- options.isContainAnnotations = true
|
|
|
- options.isAllowOCR = true
|
|
|
-// if (self.isAllowOCR) {
|
|
|
-// options.isContainOCRBgImage = self.isContainOCRBgImage
|
|
|
-// if let language = self.ocrLanguage {
|
|
|
-// options.language = language
|
|
|
-// } else {
|
|
|
-// options.language = .english
|
|
|
-// }
|
|
|
-// } else {
|
|
|
- options.isContainImages = true
|
|
|
-// options.isContainOCRBgImage = false
|
|
|
-// }
|
|
|
- self.converter.convert(toFilePath: self.outputFilePath, pageIndexs: self.pages, options: options)
|
|
|
- return
|
|
|
- }
|
|
|
+// if self.convertType == .rtf{
|
|
|
+// self.converter = CPDFConverterRtf(url: URL(fileURLWithPath: self.filePath), password: self.password)
|
|
|
+// self.converter.delegate = self
|
|
|
+// let options = CPDFConvertRtfOptions()
|
|
|
+// options.isContainAnnotations = true
|
|
|
+// options.isAllowOCR = true
|
|
|
+//// if (self.isAllowOCR) {
|
|
|
+//// options.isContainOCRBgImage = self.isContainOCRBgImage
|
|
|
+//// if let language = self.ocrLanguage {
|
|
|
+//// options.language = language
|
|
|
+//// } else {
|
|
|
+//// options.language = .english
|
|
|
+//// }
|
|
|
+//// } else {
|
|
|
+// options.isContainImages = true
|
|
|
+//// options.isContainOCRBgImage = false
|
|
|
+//// }
|
|
|
+// self.converter.convert(toFilePath: self.outputFilePath, pageIndexs: self.pages, options: options)
|
|
|
+// return
|
|
|
+// }
|
|
|
+
|
|
|
+// if self.convertType == .html{
|
|
|
+// self.converter = CPDFConverterHtml.init(url: URL(fileURLWithPath: filePath), password: self.password)
|
|
|
+// self.converter.delegate = self
|
|
|
+// let options = CPDFConvertHtmlOptions()
|
|
|
+// options.isContainAnnotations = true
|
|
|
+// options.isAllowOCR = true
|
|
|
+//// if (self.isAllowOCR) {
|
|
|
+//// options.isContainOCRBgImage = self.isContainOCRBgImage
|
|
|
+//// if let language = self.ocrLanguage {
|
|
|
+//// options.language = language
|
|
|
+//// } else {
|
|
|
+//// options.language = .english
|
|
|
+//// }
|
|
|
+//// } else {
|
|
|
+// options.isContainImages = true
|
|
|
+//// options.isContainOCRBgImage = false
|
|
|
+//// }
|
|
|
+// self.converter.convert(toFilePath: self.outputFilePath, pageIndexs: self.pages, options: options)
|
|
|
+// return
|
|
|
+// }
|
|
|
if self.convertType == .text{
|
|
|
self.converter = CPDFConverterTxt.init(url: URL(fileURLWithPath: filePath), password: self.password)
|
|
|
self.converter.delegate = self
|