KMConvertCSVWindowController.swift 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. //
  2. // KMConvertCSVWindowController.swift
  3. // PDF Reader Pro
  4. //
  5. // Created by tangchao on 2022/12/6.
  6. //
  7. import Cocoa
  8. // 转档 CSV 窗口
  9. class KMConvertCSVWindowController: KMConvertBaseWindowController {
  10. override var fileExtension: String {
  11. let settingView: KMConvertCSVSettingView = self.settingView as! KMConvertCSVSettingView
  12. if settingView.selectedSettingIndex == 0 {
  13. return KMPDFConvert.pathExtension(.csv, false)
  14. } else {
  15. return KMPDFConvert.pathExtension(.csv, true)
  16. }
  17. }
  18. override func initContentView() {
  19. super.initContentView()
  20. self.titleLabel.stringValue = NSLocalizedString("PDF to CSV", comment: "")
  21. }
  22. override func initSettingView() -> KMConvertSettingView? {
  23. return KMConvertCSVSettingView.createFromNib()
  24. }
  25. override func initConvert() -> KMPDFConvert {
  26. return KMPDFConvertCSV()
  27. }
  28. override func convertModelAppendParams(convert: KMPDFConvert) {
  29. let settingView: KMConvertCSVSettingView = self.settingView as! KMConvertCSVSettingView
  30. if settingView.selectedSettingIndex == 0 {
  31. convert.isExtractTable = false
  32. } else {
  33. convert.isExtractTable = true
  34. }
  35. }
  36. }