// // KMConvertExcelWindowController.swift // PDF Master // // Created by tangchao on 2022/12/6. // import Cocoa // 转档 Excel 窗口 class KMConvertExcelWindowController: KMConvertBaseWindowController { override var fileExtension: String { return KMPDFConvert.pathExtension(.excel) } override func initDefaultValue() { super.initDefaultValue() self.titleLabel.stringValue = NSLocalizedString("PDF to Excel", comment: "") } override func initSettingView() -> KMConvertSettingView? { return KMConvertExcelSettingView.createFromNib() } override func initConvert() -> KMPDFConvert { return KMPDFConvertExcel() } override func convertModelAppendParams(convert: KMPDFConvert) { super.convertModelAppendParams(convert: convert) let settingView: KMConvertExcelSettingView = self.settingView as! KMConvertExcelSettingView if settingView.selectedSettingIndex == 0 { convert.isExtractTable = false convert.isExtractText = false if (settingView.selectedSheetIndex == 0) { convert.isAllInOneSheet = false } else if (settingView.selectedSheetIndex == 1) { convert.isAllInOneSheet = true } } else if settingView.selectedSettingIndex == 1 { convert.isAllInOneSheet = false convert.isExtractText = false convert.isExtractTable = true convert.extractTableIndex = settingView.selectedTableFormatIndex } else if (settingView.selectedSettingIndex == 2) { convert.isAllInOneSheet = false convert.isExtractTable = false convert.isExtractText = true } } }