KMConvertHtmlWindowController.swift 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. //
  2. // KMConvertHtmlWindowController.swift
  3. // PDF Reader Pro
  4. //
  5. // Created by User-Tangchao on 2024/10/29.
  6. //
  7. import Cocoa
  8. class KMConvertHtmlWindowController: KMConvertBaseWindowController {
  9. override var fileExtension: String {
  10. return KMPDFConvert.pathExtension(.html)
  11. }
  12. override func initContentView() {
  13. super.initContentView()
  14. self.titleLabel.stringValue = NSLocalizedString("PDF to HTML", comment: "")
  15. }
  16. override func initSettingView() -> KMConvertSettingView? {
  17. return KMConvertHtmlSettingView.html_createFromNib()
  18. }
  19. override func initConvert() -> KMPDFConvert {
  20. return KMPDFConvertHTML()
  21. }
  22. override func convertModelAppendParams(convert: KMPDFConvert) {
  23. super.convertModelAppendParams(convert: convert)
  24. if let _convert = convert as? KMPDFConvertHTML {
  25. let settingView: KMConvertHtmlSettingView = self.settingView as! KMConvertHtmlSettingView
  26. let pageIndex = settingView.pageIndex
  27. if (pageIndex == 0) {
  28. _convert.paneOptions = .singlePage
  29. } else if pageIndex == 1 {
  30. _convert.paneOptions = .singlePageNavigationByBookmarks
  31. } else if pageIndex == 2 {
  32. _convert.paneOptions = .multiplePages
  33. } else if pageIndex == 3 {
  34. _convert.paneOptions = .multiplePagesSplitByBookmarks
  35. }
  36. }
  37. }
  38. }