12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758 |
- //
- // KMConvertExcelWindowController.swift
- // PDF Reader Pro
- //
- // Created by tangchao on 2022/12/6.
- //
- import Cocoa
- // 转档 Excel 窗口
- class KMConvertExcelWindowController: KMConvertBaseWindowController {
- override var fileExtension: String {
- return KMPDFConvert.pathExtension(.excel)
- }
-
- override func initContentView() {
- super.initContentView()
- self.titleLabel.stringValue = NSLocalizedString("PDF to Excel", comment: "")
- self.setupContentHeight(height: 391+20)
- }
-
- 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
- }
- }
-
- }
|