KMConvertWordWindowController.swift 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. //
  2. // KMConvertWordWindowController.swift
  3. // PDF Master
  4. //
  5. // Created by tangchao on 2022/12/6.
  6. //
  7. import Cocoa
  8. import ComPDFKit_Conversion
  9. // 转档 Word 窗口
  10. class KMConvertWordWindowController: KMConvertBaseWindowController {
  11. override var fileExtension: String {
  12. return KMPDFConvert.pathExtension(.word)
  13. }
  14. override func initDefaultValue() {
  15. super.initDefaultValue()
  16. self.titleLabel.stringValue = NSLocalizedString("PDF to Word", comment: "")
  17. }
  18. override func initSettingView() -> KMConvertSettingView? {
  19. return KMConvertWordSettingView.createFromNib()
  20. }
  21. override func initConvert() -> KMPDFConvert {
  22. return KMPDFConvertWord()
  23. }
  24. override func convertModelAppendParams(convert: KMPDFConvert) {
  25. super.convertModelAppendParams(convert: convert)
  26. if let _convert = convert as? KMPDFConvertWord {
  27. let settingView: KMConvertWordSettingView = self.settingView as! KMConvertWordSettingView
  28. if (settingView.pageSettingSelectedIndex == 0) {
  29. // convert.isAllInOneSheet = false
  30. _convert.layoutOptions = .retainFlowingText
  31. } else {
  32. /// 流排
  33. _convert.layoutOptions = .retainPageLayout
  34. }
  35. }
  36. }
  37. }