KMProductModel.swift 57 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989
  1. //
  2. // KMProductModel.swift
  3. // PDF Reader Pro
  4. //
  5. // Created by wanjun on 2024/11/6.
  6. //
  7. import Foundation
  8. import Combine
  9. #if !VERSION_DMG
  10. import StoreKit
  11. #endif
  12. @objc enum KMCompareTableType : Int {
  13. case trial = 0 // 试用比较表
  14. case dmg_Base // DMG 购买比较表
  15. case dmg_Upgrades1 // DMG 升级比较表 39.99
  16. case dmg_Upgrades2 // DMG 升级比较表 49.99
  17. case lite_Base // Lite 基础版
  18. case lite_MacWindows // Lite Mac&Windows双平台高级版永久
  19. case pro_Base // Pro 基础版
  20. case pro_Advanced // Pro Mac单平台高级版永久
  21. }
  22. @objc enum KMCompareProductType : Int {
  23. case free = 0 // 免费
  24. case freeTrial // 试用
  25. case allPlatformStandard // 全平台标准版年订阅
  26. case dualPlatformAdvanced // Mac&Windows双平台高级版永久
  27. case allPlatformAdvanced_6 // 全平台高级版6个月订阅
  28. case allPlatformAdvanced_12 // 全平台高级版12个月订阅
  29. case macPlatformAdvanced // MAC单平台高级版永久
  30. }
  31. @objc enum KMPurchasedProductType : Int {
  32. case fourDevicesAllAccessPackNew6months_lite = 0 // 4_devices_all_access_pack_new_6months(订阅)
  33. case fourDevicesAllAccessPackNew12months_lite // 4_devices_all_access_pack_12months(订阅)
  34. // case allAccessPackNew6months_lite // all_access_pack_new_6months(订阅)
  35. // case allAccessPack12months_lite // all_access_pack_12months(订阅)
  36. // case allAccessPack6months_lite // all_access_pack_6months(订阅)
  37. case aiAllAccessPack1month_lite // ai_all_access_pack_1month(订阅)
  38. case aiAllAccessPack12month_lite // ai_all_access_pack_12month(订阅)
  39. case allAccessPackPermanent_lite // all_access_pack_permanent(永久)
  40. case advancedAddDevicesAllAccessPack12months_lite // advanced_add_devices_all_access_pack_12months(订阅)
  41. case advancedAdd2DevicesAllAccessPack12months_lite // advanced_add_2_devices_all_access_pack_12months(订阅)
  42. case aiAllAccessPack1month_pro // ai_all_access_pack_1month(订阅)
  43. case aiAllAccessPack12month_pro // ai_all_access_pack_1month(订阅)
  44. case pdfToOfficePackPermanent_pro // pdf_to_office_pack_permanent(永久)
  45. case fourDevicesAllAccessPack12months_pro // 4_devices_all_access_pack_12months(全平台高级年订阅)
  46. case standardAddDevicesAllAccessPack12months_pro // standard_add_devices_all_access_pack_12months(订阅)
  47. case advancedAddDevicesAllAccessPack12months_pro // advanced_add_devices_all_access_pack_12months(订阅)
  48. case advancedAdd2DevicesAllAccessPack12months_pro // advanced_add_2_devices_all_access_pack_12months(订阅)
  49. case pdfReaderProStandard_dmg // 全平台标准版年订阅
  50. case pdfReaderProAdvanced_dmg // 全平台高级版年订阅
  51. case pdfReaderProPermanent_dmg // Mac&Windows双平台高级版永久
  52. case pdfReaderProAIAnnual_dmg // AI 年订阅
  53. case pdfReaderProAIMonthly_dmg // AI 月订阅
  54. case pdfToOffice_dmg // 转档包 永久
  55. case add2Device_dmg // 多设备全平台
  56. case add3Device_dmg // 单平台升级高级版
  57. }
  58. typealias AppstorePurchaseComplete = (_ success: Bool,_ msg: String) -> Void
  59. @objcMembers
  60. class KMProductModel: ObservableObject {
  61. static let shared = KMProductModel()
  62. /**
  63. 比较表类型
  64. */
  65. @Published var state: KMCompareTableType = .trial
  66. /**
  67. 高级版半年 或 年订阅,true为年订阅,false为半年订阅,默认true为年订阅
  68. */
  69. @Published var isPurchaseSwitch: Bool = true
  70. // MARK: DMG Public Property
  71. /**
  72. DMG 版本所有已经上架产品记录(暂时无教育优惠)
  73. */
  74. var dmgProductDatas: KMMemberProductResult?
  75. /**
  76. DMG 版本 已经登录用户 最后一次价格获取
  77. */
  78. var dmgLastGetProductPriceInfos: KMMemberProductResult?
  79. /**
  80. DMG 版本 已经登录用户 最后一次批量价格获取
  81. */
  82. var dmgLastGetBatchProductPriceInfos: KMMemberProductResult?
  83. /**
  84. DMG 版本 已经登录用户 最后一次验证商品优惠券价格获取
  85. */
  86. var dmgLastCheckCouponProductPriceInfos: KMMemberProductResult?
  87. /**
  88. DMG 版本 已经登录用户 最后一次创建的买断订单返回信息
  89. */
  90. var dmgLastCreatOrderProductInfos: KMMemberProductResult?
  91. /**
  92. DMG 版本 已经登录用户 最后一次创建的买断订单返回信息
  93. */
  94. var dmgLastCreatSubscriberProductInfos: KMMemberProductResult?
  95. // MARK: DMG Public Method
  96. func checkConnectionAvailable() -> Void {
  97. if KMMemberCenterManager.manager.isConnectionAvailable() == false {
  98. let alert = NSAlert()
  99. alert.alertStyle = .critical
  100. alert.messageText = NSLocalizedString("Error Information", comment: "")
  101. alert.informativeText = NSLocalizedString("Please make sure your internet connection is available.", comment: "")
  102. alert.addButton(withTitle: NSLocalizedString("OK", comment: ""))
  103. alert.runModal()
  104. return
  105. }
  106. }
  107. /**
  108. @abstract 获取DMG服务器架上所有商品 (得到的价格是原始价格)
  109. @param
  110. */
  111. func getDMGProductDatas( _ complete: @escaping KMMemberProductComplete) -> Void {
  112. checkConnectionAvailable()
  113. KMMemberCenterManager.manager.getListingProducts(isEducation: 0) { [weak self] success, result in
  114. guard let productsArrays : KMMemberProductResult = result else { return }
  115. self?.dmgProductDatas = productsArrays
  116. complete(success, result)
  117. }
  118. if KMMemberInfo.shared.isLogin {
  119. // getDMGProductPriceInfosForMember(productId: "SP2024102300004", isEducation: 0) { [weak self] success, result in
  120. //
  121. //
  122. // }
  123. // getDMGBatchProductPriceInfosForMember(productId: "SP2024102300004", num: 10) { [weak self] success, result in
  124. //
  125. //
  126. // }
  127. // getDMGProductListInfosForMember(orderStatus: 0) { [weak self] success, result in
  128. //
  129. // }
  130. //创建买断订单
  131. // creatOrder(productId: "SP2024102300004", paymentMethod: 0, price: "119.99", discountFlag: 0, couponCode: "", num: 1) { [weak self] success, result in
  132. //
  133. // }
  134. //创建订阅订单(创建买断订单后会报错已经是购买用户,不能重复购买)
  135. // createSubscriber(productId: "SP2024102300003", paymentMethod: 0, price: "99.99", discountFlag: 0, couponCode: "", num: 1) { [weak self] success, result in
  136. //
  137. // }
  138. // getDMGProductOrderIdInfosForMember(orderId: "94b10d5f1ca193948e005503bff0df11") { [weak self] success, result in
  139. //
  140. // }
  141. }
  142. }
  143. /**
  144. @abstract 获取DMG产品价格(美元)
  145. */
  146. func getDMGPrice(productCode: String) -> String {
  147. guard let productModels = dmgProductDatas?.listingProducts else { return "" }
  148. for model in productModels {
  149. if model.code == productCode {
  150. return model.price.stringValue
  151. }
  152. }
  153. return ""
  154. }
  155. /**
  156. @abstract 获取DMG产品价格(人民币)
  157. */
  158. func getDMGCNYPrice(productCode: String) -> String {
  159. guard let productModels = dmgProductDatas?.listingProducts else { return "" }
  160. for model in productModels {
  161. if model.code == productCode {
  162. return model.cnyPrice.stringValue
  163. }
  164. }
  165. return ""
  166. }
  167. /**
  168. @abstract 获取DMG产品折扣价格(美元)
  169. */
  170. func getDMGDisplayPrice(productCode: String) -> String {
  171. guard let productModels = dmgProductDatas?.listingProducts else { return "" }
  172. for model in productModels {
  173. if model.code == productCode {
  174. return model.displayPrice.stringValue
  175. }
  176. }
  177. return ""
  178. }
  179. /**
  180. @abstract 获取DMG产品折扣价格(人民币)
  181. */
  182. func getDMGDisplayCNYPrice(productCode: String) -> String {
  183. guard let productModels = dmgProductDatas?.listingProducts else { return "" }
  184. for model in productModels {
  185. if model.code == productCode {
  186. return model.displayCnyPrice.stringValue
  187. }
  188. }
  189. return ""
  190. }
  191. /**
  192. @abstract 获取登录用户价格(建立订单时需要用到)
  193. @param productId 购买的产品id
  194. @param isEducation 是否教育优惠
  195. @param complete 回调
  196. */
  197. func getDMGProductPriceInfosForMember(productId: String, isEducation: Int, _ complete: @escaping KMMemberProductComplete) {
  198. checkConnectionAvailable()
  199. //暂时无教育优惠,先固定传 0
  200. KMMemberCenterManager.manager.getProductPriceForBuy(productId: productId, isEducation: 0, userId:KMMemberInfo.shared.userID) { [weak self] success, result in
  201. if success {
  202. guard let productsArrays : KMMemberProductResult = result else {
  203. complete(false, result)
  204. return
  205. }
  206. self?.dmgLastGetProductPriceInfos = productsArrays
  207. complete(true, productsArrays)
  208. } else {
  209. complete(false, result)
  210. }
  211. }
  212. }
  213. /**
  214. @abstract 获取批量阶段购买价格(建立订单时需要用到)
  215. @param productId 购买的产品id
  216. @param num 批量个数
  217. @param complete 回调
  218. */
  219. func getDMGBatchProductPriceInfosForMember(productId: String, num: Int, _ complete: @escaping KMMemberProductComplete) {
  220. checkConnectionAvailable()
  221. KMMemberCenterManager.manager.getBatchProductPrice(productId: productId, num: num) { [weak self] success, result in
  222. if success {
  223. guard let productsArrays : KMMemberProductResult = result else {
  224. complete(false, result)
  225. return
  226. }
  227. self?.dmgLastGetBatchProductPriceInfos = productsArrays
  228. complete(true, productsArrays)
  229. } else {
  230. complete(false, result)
  231. }
  232. }
  233. }
  234. /**
  235. @abstract 验证商品优惠券(建立订单时需要用到)
  236. @param productId 购买的产品id
  237. @param code 优惠券
  238. @param complete 回调
  239. */
  240. func getDMGCheckCouponProductPriceInfosForMember(productId: String, code: String, _ complete: @escaping KMMemberProductComplete) {
  241. checkConnectionAvailable()
  242. KMMemberCenterManager.manager.checkCoupon(productId: productId, userId: KMMemberInfo.shared.userID, code: code) { [weak self] success, result in
  243. if success {
  244. guard let productsArrays : KMMemberProductResult = result else {
  245. complete(false, result)
  246. return
  247. }
  248. self?.dmgLastCheckCouponProductPriceInfos = productsArrays
  249. complete(true, productsArrays)
  250. } else {
  251. complete(false, result)
  252. }
  253. }
  254. }
  255. /**
  256. @abstract 获取订单列表
  257. @param orderStatus 0全部1待支付
  258. @param complete 回调
  259. */
  260. func getDMGProductListInfosForMember(orderStatus: Int, _ complete: @escaping KMMemberRequestInfoComplete) {
  261. checkConnectionAvailable()
  262. KMMemberCenterManager.manager.getOrderListByStatus(orderStatus: orderStatus) { [weak self] success, result in
  263. if success {
  264. guard let productsInfos : NSDictionary = result else {
  265. complete(false, result)
  266. return
  267. }
  268. complete(true, productsInfos)
  269. } else {
  270. complete(false, result)
  271. }
  272. }
  273. }
  274. /**
  275. @abstract 创建订单(买断)
  276. @param productId 产品id
  277. @param paymentMethod 支付方式 PAYPAL(0),ALIPAY(1),WXPAY(2),PADDLE(3)
  278. @param price 价格
  279. @param discountFlag 0原价,1优惠券,2升级,3教育优惠,4批量购买,5黑五折扣
  280. @param couponCode 优惠卷
  281. @param num 批量购买数量
  282. @param complete 回调
  283. */
  284. func creatOrder(productId: String, paymentMethod: Int, price: String, discountFlag: Int, couponCode: String, num: Int, _ complete: @escaping KMMemberProductComplete) {
  285. checkConnectionAvailable()
  286. KMMemberCenterManager.manager.createOrder(productId: productId, paymentMethod: paymentMethod, price: price, discountFlag: discountFlag, couponCode: couponCode, num: num) { [weak self] success, result in
  287. if success {
  288. guard let productsArrays : KMMemberProductResult = result else {
  289. complete(false, result)
  290. return
  291. }
  292. self?.dmgLastCreatOrderProductInfos = productsArrays
  293. complete(true, productsArrays)
  294. } else {
  295. complete(false, result)
  296. }
  297. }
  298. }
  299. /**
  300. @abstract 创建订单(订阅)
  301. @param productId 产品id
  302. @param paymentMethod 支付方式 PAYPAL(0),ALIPAY(1),WXPAY(2),PADDLE(3)
  303. @param price 价格
  304. @param discountFlag 0原价,1优惠券,2升级,3教育优惠,4批量购买,5黑五折扣
  305. @param couponCode 优惠卷
  306. @param num 批量购买数量
  307. @param complete 回调
  308. */
  309. func createSubscriber(productId: String, paymentMethod: Int, price: String, discountFlag: Int, couponCode: String, num: Int, _ complete: @escaping KMMemberProductComplete) {
  310. checkConnectionAvailable()
  311. KMMemberCenterManager.manager.createSubscriber(productId: productId, paymentMethod: paymentMethod, price: price, discountFlag: discountFlag, couponCode: couponCode, num: num) { [weak self] success, result in
  312. if success {
  313. guard let productsArrays : KMMemberProductResult = result else {
  314. complete(false, result)
  315. return
  316. }
  317. self?.dmgLastCreatSubscriberProductInfos = productsArrays
  318. complete(true, productsArrays)
  319. } else {
  320. complete(false, result)
  321. }
  322. }
  323. }
  324. /**
  325. @abstract 支付后查询订单状态
  326. @param productId 购买的产品id
  327. @param complete 回调
  328. */
  329. func getDMGProductOrderIdInfosForMember(orderId: String, _ complete: @escaping KMMemberRequestInfoComplete) {
  330. checkConnectionAvailable()
  331. KMMemberCenterManager.manager.getStateByOrderId(orderId: orderId) { [weak self] success, result in
  332. if success {
  333. guard let productsInfos : NSDictionary = result else {
  334. complete(false, result)
  335. return
  336. }
  337. complete(true, productsInfos)
  338. } else {
  339. complete(false, result)
  340. }
  341. }
  342. }
  343. // MARK: Public Method
  344. /**
  345. @abstract 根据当前权益获取比较表类型
  346. @param
  347. */
  348. func getCurrentComparisonTableType() -> Void {
  349. let userScenarioType = KMMemberInfo.shared.userScenarioType
  350. let platforms = KMMemberInfo.shared.vip_platforms
  351. let platformsArray = platforms
  352. .components(separatedBy: ",")
  353. .map { $0.trimmingCharacters(in: .whitespaces) }
  354. if userScenarioType == .lite_type1 ||
  355. userScenarioType == .lite_type3 ||
  356. userScenarioType == .lite_type11 ||
  357. userScenarioType == .lite_type4 ||
  358. userScenarioType == .lite_type5 ||
  359. userScenarioType == .lite_type9 ||
  360. userScenarioType == .lite_type13 ||
  361. userScenarioType == .lite_type7 ||
  362. userScenarioType == .lite_type8 {
  363. if userScenarioType == .lite_type1 {
  364. state = .trial
  365. } else if userScenarioType == .lite_type3 || userScenarioType == .lite_type11 {
  366. state = .lite_Base
  367. } else if userScenarioType == .lite_type4 || userScenarioType == .lite_type5 || userScenarioType == .lite_type9 || userScenarioType == .lite_type13 {
  368. state = .lite_MacWindows
  369. } else if userScenarioType == .lite_type7 || userScenarioType == .lite_type8 {
  370. if KMMemberInfo.shared.vip_paymentModel == "1" && KMMemberInfo.shared.vip_cycle == 4 && platformsArray.count == 4 {
  371. state = .lite_MacWindows
  372. } else {
  373. state = .lite_Base
  374. }
  375. }
  376. } else if userScenarioType == .pro_type1 ||
  377. userScenarioType == .pro_type3 ||
  378. userScenarioType == .pro_type4 {
  379. if userScenarioType == .pro_type1 ||
  380. userScenarioType == .pro_type4 {
  381. state = .pro_Advanced
  382. } else if userScenarioType == .pro_type3 {
  383. state = .pro_Base
  384. }
  385. }
  386. }
  387. /**
  388. 对应商品价格
  389. */
  390. func getProductPrice(_ type: KMPurchasedProductType) -> String {
  391. #if VERSION_FREE
  392. #if VERSION_DMG
  393. // DMG
  394. if type == .pdfReaderProStandard_dmg {
  395. return getDMGPrice(productCode: "standard-annual-subscription")
  396. } else if type == .pdfReaderProAdvanced_dmg {
  397. return getDMGPrice(productCode: "advanced-annual-subscription")
  398. } else if type == .pdfReaderProPermanent_dmg {
  399. return getDMGPrice(productCode: "advanced-permanent")
  400. } else if type == .pdfReaderProAIAnnual_dmg {
  401. return getDMGPrice(productCode: "ai-subscription-year-trail")
  402. } else if type == .pdfReaderProAIMonthly_dmg {
  403. return getDMGPrice(productCode: "ai-subscription-month")
  404. } else if type == .pdfToOffice_dmg {
  405. return getDMGPrice(productCode: "PDF to Office")
  406. } else if type == .add2Device_dmg {
  407. return getDMGPrice(productCode: "Add 2-Device · Advanced Annual")
  408. } else if type == .add3Device_dmg {
  409. return getDMGPrice(productCode: "Add 3-Device · Advanced Annual")
  410. }
  411. #else
  412. // AppStore 免费版本
  413. if type == .fourDevicesAllAccessPackNew6months_lite {
  414. if let product = IAPProductsManager.default().fourDevicesAllAccessPackNew6Months_lite, product.isOffers {
  415. return product.offersPrice()
  416. } else {
  417. return IAPProductsManager.default().fourDevicesAllAccessPackNew6Months_lite.price()
  418. }
  419. } else if type == .fourDevicesAllAccessPackNew12months_lite {
  420. if let product = IAPProductsManager.default().fourDevicesAllAccessPackNew12months_lite, product.isOffers {
  421. return product.offersPrice()
  422. } else {
  423. return IAPProductsManager.default().fourDevicesAllAccessPackNew12months_lite.price()
  424. }
  425. } else if type == .aiAllAccessPack1month_lite {
  426. if let product = IAPProductsManager.default().aiAllAccessPack1month_lite, product.isOffers {
  427. return product.offersPrice()
  428. } else {
  429. return IAPProductsManager.default().aiAllAccessPack1month_lite.price()
  430. }
  431. } else if type == .aiAllAccessPack12month_lite {
  432. if let product = IAPProductsManager.default().aiAllAccessPack12month_lite, product.isOffers {
  433. return product.offersPrice()
  434. } else {
  435. return IAPProductsManager.default().aiAllAccessPack12month_lite.price()
  436. }
  437. } else if type == .allAccessPackPermanent_lite {
  438. if let product = IAPProductsManager.default().allAccessPackPermanent_lite, product.isOffers {
  439. return product.offersPrice()
  440. } else {
  441. return IAPProductsManager.default().allAccessPackPermanent_lite.price()
  442. }
  443. } else if type == .advancedAddDevicesAllAccessPack12months_lite {
  444. if let product = IAPProductsManager.default().advancedAddDevicesAllAccessPack12months_lite, product.isOffers {
  445. return product.offersPrice()
  446. } else {
  447. return IAPProductsManager.default().advancedAddDevicesAllAccessPack12months_lite.price()
  448. }
  449. } else if type == .advancedAdd2DevicesAllAccessPack12months_lite {
  450. if let product = IAPProductsManager.default().advancedAdd2DevicesAllAccessPack12months_lite, product.isOffers {
  451. return product.offersPrice()
  452. } else {
  453. return IAPProductsManager.default().advancedAdd2DevicesAllAccessPack12months_lite.price()
  454. }
  455. }
  456. #endif
  457. #else
  458. // AppStore 付费版
  459. if type == .aiAllAccessPack1month_pro {
  460. if let product = IAPProductsManager.default().aiAllAccessPack1month_pro, product.isOffers {
  461. return product.offersPrice()
  462. } else {
  463. return IAPProductsManager.default().aiAllAccessPack1month_pro.price()
  464. }
  465. } else if type == .aiAllAccessPack12month_pro {
  466. if let product = IAPProductsManager.default().aiAllAccessPack12month_pro, product.isOffers {
  467. return product.offersPrice()
  468. } else {
  469. return IAPProductsManager.default().aiAllAccessPack12month_pro.price()
  470. }
  471. } else if type == .pdfToOfficePackPermanent_pro {
  472. if let product = IAPProductsManager.default().pdfToOfficePackPermanent_pro, product.isOffers {
  473. return product.offersPrice()
  474. } else {
  475. return IAPProductsManager.default().pdfToOfficePackPermanent_pro.price()
  476. }
  477. } else if type == .fourDevicesAllAccessPack12months_pro {
  478. if let product = IAPProductsManager.default().fourDevicesAllAccessPack12months_pro, product.isOffers {
  479. return product.offersPrice()
  480. } else {
  481. return IAPProductsManager.default().fourDevicesAllAccessPack12months_pro.price()
  482. }
  483. } else if type == .standardAddDevicesAllAccessPack12months_pro {
  484. if let product = IAPProductsManager.default().standardAddDevicesAllAccessPack12months_pro, product.isOffers {
  485. return product.offersPrice()
  486. } else {
  487. return IAPProductsManager.default().standardAddDevicesAllAccessPack12months_pro.price()
  488. }
  489. } else if type == .advancedAddDevicesAllAccessPack12months_pro {
  490. if let product = IAPProductsManager.default().advancedAddDevicesAllAccessPack12months_pro, product.isOffers {
  491. return product.offersPrice()
  492. } else {
  493. return IAPProductsManager.default().advancedAddDevicesAllAccessPack12months_pro.price()
  494. }
  495. } else if type == .advancedAdd2DevicesAllAccessPack12months_pro {
  496. if let product = IAPProductsManager.default().advancedAdd2DevicesAllAccessPack12months_pro, product.isOffers {
  497. return product.offersPrice()
  498. } else {
  499. return IAPProductsManager.default().advancedAdd2DevicesAllAccessPack12months_pro.price()
  500. }
  501. }
  502. #endif
  503. return ""
  504. }
  505. func appstorePurchaseAction(_ tag: Int, _ complete: @escaping AppstorePurchaseComplete) -> Void {
  506. if state == .dmg_Base {
  507. var code = ""
  508. if tag == 1 {
  509. code = "standard-annual-subscription"
  510. } else if tag == 3 {
  511. code = "advanced-permanent"
  512. } else {
  513. code = "advanced-annual-subscription"
  514. }
  515. #if VERSION_DMG
  516. let embeddedWC = KMPurchaseEmbeddedWindowController.currentCode(code)
  517. embeddedWC.showWindow(nil)
  518. embeddedWC.window?.center()
  519. #endif
  520. } else if state == .dmg_Upgrades1 {
  521. #if VERSION_DMG
  522. let embeddedWC = KMPurchaseEmbeddedWindowController.currentCode("Add 2-Device · Advanced Annual")
  523. embeddedWC.showWindow(nil)
  524. embeddedWC.window?.center()
  525. #endif
  526. } else if state == .dmg_Upgrades2 {
  527. #if VERSION_DMG
  528. let embeddedWC = KMPurchaseEmbeddedWindowController.currentCode("Add 3-Device · Advanced Annual")
  529. embeddedWC.showWindow(nil)
  530. embeddedWC.window?.center()
  531. #endif
  532. } else if state == .lite_Base {
  533. if tag == 0 {
  534. if isPurchaseSwitch { membershipPurchase(.fourDevicesAllAccessPackNew12months_lite) }
  535. else { membershipPurchase(.fourDevicesAllAccessPackNew6months_lite) }
  536. } else if tag == 3 {
  537. membershipPurchase(.allAccessPackPermanent_lite)
  538. } else {
  539. membershipPurchase(.fourDevicesAllAccessPackNew12months_lite)
  540. }
  541. } else if state == .lite_MacWindows {
  542. if tag == 2 {
  543. let platforms = KMMemberInfo.shared.vip_platforms
  544. let platformsArray = platforms
  545. .components(separatedBy: ",")
  546. .map { $0.trimmingCharacters(in: .whitespaces) }
  547. if KMMemberInfo.shared.userScenarioType == .lite_type5 {
  548. if platformsArray.count == 1 {
  549. membershipPurchase(.advancedAddDevicesAllAccessPack12months_lite)
  550. } else if platformsArray.count == 2 {
  551. membershipPurchase(.advancedAdd2DevicesAllAccessPack12months_lite)
  552. }
  553. } else {
  554. if platformsArray.count == 1 {
  555. membershipPurchase(.advancedAddDevicesAllAccessPack12months_lite)
  556. } else if platformsArray.count == 2 {
  557. membershipPurchase(.advancedAdd2DevicesAllAccessPack12months_lite)
  558. } else {
  559. membershipPurchase(.advancedAdd2DevicesAllAccessPack12months_lite)
  560. }
  561. }
  562. }
  563. } else if state == .pro_Base {
  564. if KMMemberInfo.shared.userScenarioType == .pro_type3 {
  565. if tag == 2 {
  566. membershipPurchase(.standardAddDevicesAllAccessPack12months_pro)
  567. } else if tag == 3 {
  568. membershipPurchase(.pdfToOfficePackPermanent_pro)
  569. }
  570. }
  571. } else if state == .pro_Advanced {
  572. if KMMemberInfo.shared.userScenarioType == .pro_type1 {
  573. membershipPurchase(.advancedAddDevicesAllAccessPack12months_pro)
  574. } else if KMMemberInfo.shared.userScenarioType == .pro_type4 {
  575. let platforms = KMMemberInfo.shared.vip_platforms
  576. let platformsArray = platforms
  577. .components(separatedBy: ",")
  578. .map { $0.trimmingCharacters(in: .whitespaces) }
  579. if platformsArray.count == 1 {
  580. membershipPurchase(.advancedAddDevicesAllAccessPack12months_pro)
  581. } else if platformsArray.count == 2 {
  582. membershipPurchase(.advancedAdd2DevicesAllAccessPack12months_pro)
  583. } else {
  584. membershipPurchase(.advancedAdd2DevicesAllAccessPack12months_pro)
  585. }
  586. }
  587. } else {
  588. if tag == 2 {
  589. membershipPurchase(.fourDevicesAllAccessPackNew12months_lite)
  590. }
  591. }
  592. }
  593. func appStoreEquityVerification(_ notification: Notification,_ complete: @escaping KMMemberProductComplete) -> Void {
  594. #if VERSION_FREE
  595. #if VERSION_DMG
  596. // DMG
  597. #else
  598. // AppStore 免费版本
  599. if let userInfo = notification.object as? SKPaymentTransaction,
  600. let transactionId = userInfo.transactionIdentifier as? String,
  601. let productId = userInfo.payment.productIdentifier as? String {
  602. print("Transaction ID: \(transactionId)")
  603. print("product ID: \(productId)")
  604. var productCode = ""
  605. var isSubscribed = false
  606. if productId == "com.pdfreaderpro.mac_free.member.all_access_pack_advanced_6months.001" {
  607. productCode = "advanced-annual-subscription-six-month"
  608. if IAPProductsManager.default().fourDevicesAllAccessPackNew6Months_lite.isSubscribed {
  609. isSubscribed = true
  610. }
  611. } else if productId == "com.pdfreaderpro.mac_free.member.all_access_pack_advanced_annual.001" {
  612. productCode = "advanced-annual-subscription"
  613. if IAPProductsManager.default().fourDevicesAllAccessPackNew12months_lite.isSubscribed {
  614. isSubscribed = true
  615. }
  616. } else if productId == "com.pdfreaderpro.mac_free.member.all_access_pack_new_6months.001" {
  617. productCode = "advanced-annual-subscription-six-month"
  618. if IAPProductsManager.default().allAccessPackNew6months_lite.isSubscribed {
  619. isSubscribed = true
  620. }
  621. } else if productId == "com.pdfreaderpro.mac_free.member.all_access_pack_12months.001" {
  622. productCode = "advanced-annual-subscription"
  623. if IAPProductsManager.default().allAccessPack12months_lite.isSubscribed {
  624. isSubscribed = true
  625. }
  626. } else if productId == "com.pdfreaderpro.mac_free.member.all_access_pack_6months.001" {
  627. productCode = "advanced-annual-subscription-six-month"
  628. if IAPProductsManager.default().allAccessPack6months_lite.isSubscribed {
  629. isSubscribed = true
  630. }
  631. } else if productId == "com.pdfreaderpro.mac_free.member.ai_pack_1_month" {
  632. productCode = "ai-subscription-month"
  633. if IAPProductsManager.default().aiAllAccessPack1month_lite.isSubscribed {
  634. isSubscribed = true
  635. }
  636. } else if productId == "com.pdfreaderpro.mac_free.member.ai_pack_12_month" {
  637. productCode = "ai-subscription-year-trail"
  638. if IAPProductsManager.default().aiAllAccessPack12month_lite.isSubscribed {
  639. isSubscribed = true
  640. }
  641. } else if productId == "com.pdfreaderpro.mac_free.member.all_access_pack_advanced_permanent_license.001" {
  642. productCode = "advanced-permanent"
  643. if IAPProductsManager.default().allAccessPackPermanent_lite.isSubscribed {
  644. isSubscribed = true
  645. }
  646. } else if productId == "com.pdfreaderpro.mac_free.member.advanced_add_devices_all_access_pack_advanced_annual.001" {
  647. productCode = "advanced-annual-subscription-single-upgrade"
  648. if IAPProductsManager.default().advancedAddDevicesAllAccessPack12months_lite.isSubscribed {
  649. isSubscribed = true
  650. }
  651. } else if productId == "com.pdfreaderpro.mac_free.member.advanced_add_2_devices_all_access_pack_advanced_annual.001" {
  652. productCode = "advanced-annual-subscription-multi-upgrade"
  653. if IAPProductsManager.default().advancedAdd2DevicesAllAccessPack12months_lite.isSubscribed {
  654. isSubscribed = true
  655. }
  656. }
  657. if isSubscribed {
  658. KMMemberCenterManager.manager.appStoreEquityVerification(applePayProductId: productId, transactionId: transactionId, productCode: productCode) { success, result in
  659. if success {
  660. complete(true, result)
  661. } else {
  662. complete(false, result)
  663. }
  664. }
  665. }
  666. } else {
  667. print("Transaction ID not found in notification.")
  668. }
  669. #endif
  670. #else
  671. // AppStore 付费版
  672. if let userInfo = notification.object as? SKPaymentTransaction,
  673. let transactionId = userInfo.transactionIdentifier as? String,
  674. let productId = userInfo.payment.productIdentifier as? String {
  675. print("Transaction ID: \(transactionId)")
  676. print("product ID: \(productId)")
  677. var productCode = ""
  678. var isSubscribed = false
  679. if productId == "com.pdfreaderpro.mac.ai_pack_1_month" {
  680. productCode = "ai-subscription-month"
  681. if IAPProductsManager.default().aiAllAccessPack1month_pro.isSubscribed {
  682. isSubscribed = true
  683. }
  684. } else if productId == "com.pdfreaderpro.mac.ai_pack_12_month" {
  685. productCode = "ai-subscription-year-trail"
  686. if IAPProductsManager.default().aiAllAccessPack12month_pro.isSubscribed {
  687. isSubscribed = true
  688. }
  689. } else if productId == "com.pdfreaderpro.mac.pdf_to_office_pack_permanent_license.001" {
  690. productCode = "advanced-permanent-mac-upgrade"
  691. if IAPProductsManager.default().pdfToOfficePackPermanent_pro.isSubscribed {
  692. isSubscribed = true
  693. }
  694. } else if productId == "com.pdfreaderpro.mac.all_access_pack_advanced_annual.001" {
  695. productCode = "advanced-permanent-mac-upgrade"
  696. if IAPProductsManager.default().fourDevicesAllAccessPack12months_pro.isSubscribed {
  697. isSubscribed = true
  698. }
  699. } else if productId == "com.pdfreaderpro.mac.advanced_add_devices_all_access_pack_advanced_annual.001" {
  700. productCode = "advanced-annual-subscription-standard-upgrade"
  701. if IAPProductsManager.default().standardAddDevicesAllAccessPack12months_pro.isSubscribed {
  702. isSubscribed = true
  703. }
  704. } else if productId == "com.pdfreaderpro.mac.advanced_add_devices_all_access_pack_advanced_annual.001" {
  705. productCode = "advanced-annual-subscription-single-upgrade"
  706. if IAPProductsManager.default().advancedAddDevicesAllAccessPack12months_pro.isSubscribed {
  707. isSubscribed = true
  708. }
  709. } else if productId == "com.pdfreaderpro.mac.advanced_add_2_devices_all_access_pack_advanced_annual.001" {
  710. productCode = "advanced-annual-subscription-multi-upgrade"
  711. if IAPProductsManager.default().advancedAdd2DevicesAllAccessPack12months_pro.isSubscribed {
  712. isSubscribed = true
  713. }
  714. }
  715. if isSubscribed {
  716. KMMemberCenterManager.manager.appStoreEquityVerification(applePayProductId: productId, transactionId: transactionId, productCode: productCode) { success, result in
  717. if success {
  718. complete(true, result)
  719. } else {
  720. complete(false, result)
  721. }
  722. }
  723. }
  724. } else {
  725. print("Transaction ID not found in notification.")
  726. }
  727. #endif
  728. }
  729. var isCancelAutoRenew: Bool {
  730. return IAPProductsManager.default().isCancelAutoRenew()
  731. }
  732. var isShowSale: Bool {
  733. if #available(macOS 10.14.4, *), isCancelAutoRenew {
  734. let manager = IAPProductsManager.default()
  735. let isSubscribed_newlyMonth = manager?.allAccessPackNew6months_lite.isSubscribed ?? false
  736. let isSubscribed_year = manager?.allAccessPack12months_lite.isSubscribed ?? false
  737. if isSubscribed_newlyMonth || isSubscribed_year {
  738. return false
  739. }
  740. if let info = KMAdvertisementManager.manager.info.StoreUserRecovery?.content?.first, !(info.show! as NSString).boolValue {
  741. return false
  742. }
  743. return true
  744. }
  745. return false
  746. }
  747. // MARK: Private Method
  748. /**
  749. 会员购买
  750. */
  751. private func membershipPurchase(_ type: KMPurchasedProductType) -> Void {
  752. #if !VERSION_DMG
  753. if type == .fourDevicesAllAccessPackNew6months_lite || type == .fourDevicesAllAccessPackNew12months_lite {
  754. if isPurchaseSwitch {
  755. IAPProductsManager.default().makeSubProduct(IAPProductsManager.default().fourDevicesAllAccessPackNew12months_lite, discount: isCancelAutoRenew)
  756. } else {
  757. IAPProductsManager.default().makeSubProduct(IAPProductsManager.default().fourDevicesAllAccessPackNew6Months_lite, discount: isCancelAutoRenew)
  758. }
  759. } else if type == .aiAllAccessPack1month_lite {
  760. IAPProductsManager.default().makeSubProduct(IAPProductsManager.default().aiAllAccessPack1month_lite, discount: isCancelAutoRenew)
  761. } else if type == .aiAllAccessPack12month_lite {
  762. IAPProductsManager.default().makeSubProduct(IAPProductsManager.default().aiAllAccessPack12month_lite, discount: isCancelAutoRenew)
  763. } else if type == .allAccessPackPermanent_lite {
  764. IAPProductsManager.default().makeSubProduct(IAPProductsManager.default().allAccessPackPermanent_lite, discount: isCancelAutoRenew)
  765. } else if type == .advancedAddDevicesAllAccessPack12months_lite {
  766. IAPProductsManager.default().makeSubProduct(IAPProductsManager.default().advancedAddDevicesAllAccessPack12months_lite, discount: isCancelAutoRenew)
  767. } else if type == .advancedAdd2DevicesAllAccessPack12months_lite {
  768. IAPProductsManager.default().makeSubProduct(IAPProductsManager.default().advancedAdd2DevicesAllAccessPack12months_lite, discount: isCancelAutoRenew)
  769. } else if type == .aiAllAccessPack1month_pro {
  770. IAPProductsManager.default().makeSubProduct(IAPProductsManager.default().aiAllAccessPack1month_pro, discount: isCancelAutoRenew)
  771. } else if type == .aiAllAccessPack12month_pro {
  772. IAPProductsManager.default().makeSubProduct(IAPProductsManager.default().aiAllAccessPack12month_pro, discount: isCancelAutoRenew)
  773. } else if type == .pdfToOfficePackPermanent_pro {
  774. IAPProductsManager.default().makeSubProduct(IAPProductsManager.default().pdfToOfficePackPermanent_pro, discount: isCancelAutoRenew)
  775. } else if type == .fourDevicesAllAccessPack12months_pro {
  776. IAPProductsManager.default().makeSubProduct(IAPProductsManager.default().fourDevicesAllAccessPack12months_pro, discount: isCancelAutoRenew)
  777. } else if type == .standardAddDevicesAllAccessPack12months_pro {
  778. IAPProductsManager.default().makeSubProduct(IAPProductsManager.default().standardAddDevicesAllAccessPack12months_pro, discount: isCancelAutoRenew)
  779. } else if type == .advancedAddDevicesAllAccessPack12months_pro {
  780. IAPProductsManager.default().makeSubProduct(IAPProductsManager.default().advancedAddDevicesAllAccessPack12months_pro, discount: isCancelAutoRenew)
  781. } else if type == .advancedAdd2DevicesAllAccessPack12months_pro {
  782. IAPProductsManager.default().makeSubProduct(IAPProductsManager.default().advancedAdd2DevicesAllAccessPack12months_pro, discount: isCancelAutoRenew)
  783. }
  784. #endif
  785. }
  786. // MARK: Action Method
  787. /**
  788. 恢复购买
  789. */
  790. func productRestore() -> Void {
  791. IAPProductsManager.default().restoreSubscriptions()
  792. }
  793. func privacyPolicyAction() -> Void {
  794. NSWorkspace.shared.open(URL(string: "https://www.pdfreaderpro.com/privacy-policy")!)
  795. }
  796. func termOfSerAction() -> Void {
  797. NSWorkspace.shared.open(URL(string: "https://www.pdfreaderpro.com/terms_of_service")!)
  798. }
  799. // MARK: Get & Set
  800. /**
  801. 当前比较表产品列表内容
  802. */
  803. var products: [KMCompareProductType] {
  804. if state == .trial {
  805. return [.free, .freeTrial]
  806. } else if state == .dmg_Base {
  807. return [.free, .allPlatformStandard, .allPlatformAdvanced_12, .dualPlatformAdvanced]
  808. } else if state == .dmg_Upgrades1 {
  809. return [.allPlatformAdvanced_12]
  810. } else if state == .dmg_Upgrades1 {
  811. return [.allPlatformAdvanced_12]
  812. } else if state == .lite_Base {
  813. return [.free, .allPlatformAdvanced_6, .allPlatformAdvanced_12, .dualPlatformAdvanced]
  814. } else if state == .lite_MacWindows {
  815. return [.allPlatformAdvanced_12]
  816. } else if state == .pro_Base {
  817. return [.allPlatformAdvanced_12, .macPlatformAdvanced]
  818. } else if state == .pro_Advanced {
  819. return [.allPlatformAdvanced_12]
  820. }
  821. return []
  822. }
  823. /**
  824. 比较表数据源
  825. */
  826. var dataSource: [Any] {
  827. if isPurchaseSwitch {
  828. // 试用 全平台标准版年订阅 全平台高级版6/12个月订阅 Mac&Windows双平台高级版永久 MAC单平台高级版永久
  829. //MAC单平台标准版永久
  830. return [
  831. "Benefit",
  832. ["Supported platforms", "mac, windows, ios, android", "mac, windows, ios, android", "mac, windows, ios, android", "mac, windows", "mac"],
  833. ["Maximum number of accessible devices", "4 devices", "4 devices", "4 devices", "2 devices", "1 devices"],
  834. "PDF to Office",
  835. ["Convert PDFs to Word, HTML, TXT, JPEG or PNG files", "Only first 10 pages", "Standard", "Advanced", "Advanced", "Advanced"],
  836. ["Turn PDF to PPT, Excel, RTF, CSV, and more", "Only first 10 pages", "Only first 10 pages", "✓", "✓", "✓"],
  837. ["Convert PDF to TIFF, BMP, GIF or TGA files", "Only first 10 pages", "Only first 10 pages", "✓", "✓", "✓"],
  838. "Edit PDF",
  839. ["Add and edit text in PDF", "X", "✓", "✓", "✓", "✓"],
  840. ["Edit, crop, replace image in PDF", "X", "✓", "✓", "✓", "✓"],
  841. "OCR",
  842. ["Extract texts from image-based or scanned PDF", "X", "✓", "✓", "✓", "✓"],
  843. "Organize Pages",
  844. ["Extract, rotate, rearrange, replace, add, delete pages", "X", "✓", "✓", "✓", "✓"],
  845. ["Split PDFs into multiple files", "X", "✓", "✓", "✓", "✓"],
  846. "Advanced Editing Tools",
  847. ["Merge multiple documents into a new PDF", "Up to 2 files or 20 MB", "✓", "✓", "✓", "∞", "∞"],
  848. ["Add & edit watermark", "X", "✓", "✓", "✓", "✓"],
  849. ["Add header, footer, page numbers", "X", "✓", "✓", "✓", "✓"],
  850. ["Add Bates Number", "X", "✓", "✓", "✓", "✓"],
  851. ["Insert PDF page background by color or image", "X", "✓", "✓", "✓", "✓"],
  852. ["Create fattened copies", "X", "✓", "✓", "✓", "✓"],
  853. ["Extract Images", "X", "✓", "✓", "✓", "✓"],
  854. ["Extract tables", "Only first 10 pages", "Only first 10 pages", "✓", "✓", "✓"],
  855. ["Measuring Tools", "X", "✓", "✓", "✓", "✓"],
  856. "Fill & Sign",
  857. ["Create digital signature", "X", "✓", "✓", "✓", "✓"],
  858. ["Create & Edit & Fill Adobe Fillable PDF Forms", "X", "✓", "✓", "✓", "✓"],
  859. "Security",
  860. ["Batch encrypting PDF documents", "X", "✓", "✓", "✓", "✓"],
  861. ["PDF Password Remover", "X", "✓", "✓", "✓", "✓"],
  862. ["Redact sensitive information", "X", "✓", "✓", "✓", "✓"],
  863. "Create PDF",
  864. ["Convert JPEG, JPG, PNG, TIFF, BMP or PSD files to PDFs", "1 file", "✓", "✓", "✓", "✓"],
  865. ["Create PDFs from a scanner and iOS devices", "X", "✓", "✓", "✓", "✓"],
  866. "Annotations",
  867. ["Customize PDF stamps", "X", "✓", "✓", "✓", "✓"],
  868. ["Hyperlink", "Page Number", "Page Number, URL, Email", "Page Number, URL, Email", "Page Number, URL, Email", "Page Number, URL, Email"],
  869. ["Signature", "Standard", "Advanced", "Advanced", "Advanced", "Advanced"],
  870. ["Table", "X", "✓", "✓", "✓", "✓"],
  871. "View PDF",
  872. ["Multi-tab viewer", "X", "✓", "✓", "✓", "✓"],
  873. ["Various printing types: poster, booklet, multi-page printing", "X", "✓", "✓", "✓", "✓"],
  874. ["Customize theme colors: Light Mode, Dark Mode, Sepia Mode and more", "X", "✓", "✓", "✓", "✓"],
  875. ["Split View to compare files", "X", "✓", "✓", "✓", "✓"],
  876. "Subscription Based Solution",
  877. ["Access all premium features in app", "X", "12 months", "12 months", "∞", "∞"],
  878. ["Priority customer support", "X", "✓", "✓", "✓", "✓"],
  879. ["Ad-free", "X", "✓", "✓", "✓", "✓"]
  880. ]
  881. } else {
  882. return [
  883. "Benefit",
  884. ["Supported platforms", "mac, windows, ios, android", "mac, windows, ios, android", "mac, windows, ios, android", "mac, windows", "mac"],
  885. ["Maximum number of accessible devices", "4 devices", "4 devices", "4 devices", "2 devices", "1 devices"],
  886. "PDF to Office",
  887. ["Convert PDFs to Word, HTML, TXT, JPEG or PNG files", "Only first 10 pages", "Standard", "Advanced", "Advanced", "Advanced"],
  888. ["Turn PDF to PPT, Excel, RTF, CSV, and more", "Only first 10 pages", "Only first 10 pages", "✓", "✓", "✓"],
  889. ["Convert PDF to TIFF, BMP, GIF or TGA files", "Only first 10 pages", "Only first 10 pages", "✓", "✓", "✓"],
  890. "Edit PDF",
  891. ["Add and edit text in PDF", "X", "✓", "✓", "✓", "✓"],
  892. ["Edit, crop, replace image in PDF", "X", "✓", "✓", "✓", "✓"],
  893. "OCR",
  894. ["Extract texts from image-based or scanned PDF", "X", "✓", "✓", "✓", "✓"],
  895. "Organize Pages",
  896. ["Extract, rotate, rearrange, replace, add, delete pages", "X", "✓", "✓", "✓", "✓"],
  897. ["Split PDFs into multiple files", "X", "✓", "✓", "✓", "✓"],
  898. "Advanced Editing Tools",
  899. ["Merge multiple documents into a new PDF", "Up to 2 files or 20 MB", "✓", "✓", "✓", "∞", "∞"],
  900. ["Add & edit watermark", "X", "✓", "✓", "✓", "✓"],
  901. ["Add header, footer, page numbers", "X", "✓", "✓", "✓", "✓"],
  902. ["Add Bates Number", "X", "✓", "✓", "✓", "✓"],
  903. ["Insert PDF page background by color or image", "X", "✓", "✓", "✓", "✓"],
  904. ["Create fattened copies", "X", "✓", "✓", "✓", "✓"],
  905. ["Extract Images", "X", "✓", "✓", "✓", "✓"],
  906. ["Extract tables", "Only first 10 pages", "Only first 10 pages", "✓", "✓", "✓"],
  907. ["Measuring Tools", "X", "✓", "✓", "✓", "✓"],
  908. "Fill & Sign",
  909. ["Create digital signature", "X", "✓", "✓", "✓", "✓"],
  910. ["Create & Edit & Fill Adobe Fillable PDF Forms", "X", "✓", "✓", "✓", "✓"],
  911. "Security",
  912. ["Batch encrypting PDF documents", "X", "✓", "✓", "✓", "✓"],
  913. ["PDF Password Remover", "X", "✓", "✓", "✓", "✓"],
  914. ["Redact sensitive information", "X", "✓", "✓", "✓", "✓"],
  915. "Create PDF",
  916. ["Convert JPEG, JPG, PNG, TIFF, BMP or PSD files to PDFs", "1 file", "✓", "✓", "✓", "✓"],
  917. ["Create PDFs from a scanner and iOS devices", "X", "✓", "✓", "✓", "✓"],
  918. "Annotations",
  919. ["Customize PDF stamps", "X", "✓", "✓", "✓", "✓"],
  920. ["Hyperlink", "Page Number", "Page Number, URL, Email", "Page Number, URL, Email", "Page Number, URL, Email", "Page Number, URL, Email"],
  921. ["Signature", "Standard", "Advanced", "Advanced", "Advanced", "Advanced"],
  922. ["Table", "X", "✓", "✓", "✓", "✓"],
  923. "View PDF",
  924. ["Multi-tab viewer", "X", "✓", "✓", "✓", "✓"],
  925. ["Various printing types: poster, booklet, multi-page printing", "X", "✓", "✓", "✓", "✓"],
  926. ["Customize theme colors: Light Mode, Dark Mode, Sepia Mode and more", "X", "✓", "✓", "✓", "✓"],
  927. ["Split View to compare files", "X", "✓", "✓", "✓", "✓"],
  928. "Subscription Based Solution",
  929. ["Access all premium features in app", "X", "6 months", "6 months", "∞", "∞"],
  930. ["Priority customer support", "X", "✓", "✓", "✓", "✓"],
  931. ["Ad-free", "X", "✓", "✓", "✓", "✓"]
  932. ]
  933. }
  934. }
  935. }