// // KMConvertWordWindowController.swift // PDF Reader Pro // // Created by tangchao on 2022/12/6. // import Cocoa import ComPDFKit_Conversion import KMComponentLibrary // 转档 Word 窗口 class KMConvertWordWindowController: KMConvertBaseWindowController { override var fileExtension: String { return KMPDFConvert.pathExtension(.word) } override func initContentView() { super.initContentView() self.titleLabel.stringValue = NSLocalizedString("PDF to Word", comment: "") } override func initSettingView() -> KMConvertSettingView? { return KMConvertWordSettingView.createFromNib() } override func initConvert() -> KMPDFConvert { return KMPDFConvertWord() } override func convertModelAppendParams(convert: KMPDFConvert) { super.convertModelAppendParams(convert: convert) if let _convert = convert as? KMPDFConvertWord { let settingView: KMConvertWordSettingView = self.settingView as! KMConvertWordSettingView if (settingView.pageSettingSelectedIndex == 0) { _convert.layoutOptions = .retainFlowingText } else { /// 流排 _convert.layoutOptions = .retainPageLayout } } } override func updateViewColor() { super.updateViewColor() KMMainThreadExecute { let settingV = self.settingView as? KMConvertWordSettingView settingV?.pageSettingTitleLabel.textColor = ComponentLibrary.shared.getComponentColorFromKey("colorText/2") self.settingView?.updateViewColor() } } }