CPDFConverterFPTool.h 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. //
  2. // CPDFConverterFPTool.h
  3. // KdanAuto
  4. //
  5. // Created by 朱东勇 on 2023/5/9.
  6. //
  7. #import <Foundation/Foundation.h>
  8. NS_ASSUME_NONNULL_BEGIN
  9. @protocol CPDFConverterFPToolDelegate <NSObject>
  10. @optional
  11. // Going to start the transformation
  12. - (void)FPPDFConverter:(id)converter didStartConversion:(NSError *)error;
  13. // Complete the conversion
  14. - (void)FPPDFConverter:(id)converter didEndConversion:(NSError *)error;
  15. // Page progress
  16. - (void)FPPDFConverter:(id)converter
  17. pageIndex:(NSUInteger)pageIndexA
  18. progress:(NSUInteger)progress;
  19. // Finish parsing a page
  20. - (void)FPPDFConverter:(id)converter
  21. convertPDFPageIndex:(NSUInteger)pdfPageIndexA
  22. writeWordPageIndex:(NSUInteger)wordPageIndexA
  23. finshedWordPageCount:(NSUInteger)wordPageCountA;
  24. // A page cannot be converted
  25. - (void)FPPDFConverter:(id)converter
  26. convertPDFPageIndex:(NSUInteger)pdfPageIndexA
  27. faildWithError:(NSError *)error;
  28. // The document will be saved to disk
  29. - (void)FPPDFConverter:(id)converter willSaveDoc:(NSError *)error;
  30. // Catch an anomaly
  31. - (void)FPPDFConverter:(id)converter
  32. catchException:(NSException *)exception;
  33. @end
  34. @interface CPDFConverterFPTool : NSObject
  35. + (id _Nullable)createConverterFP;
  36. + (void)setDelegate:(id<CPDFConverterFPToolDelegate> _Nullable)delegate forConverterFP:(id _Nullable)converterFP;
  37. - (void)setDelegate:(id<CPDFConverterFPToolDelegate> _Nullable)delegate;
  38. + (void)stopConvertsionIfNeed:(id _Nullable)converterFP;
  39. - (void)stopConvertsionIfNeed;
  40. + (void)convertPDFForConverterFP:(id _Nullable)converterFP
  41. path:(NSString *)pdfPathA
  42. pdfPassword:(NSString * _Nullable)pdfPasswordA
  43. pdfPageIndexs:(NSArray *)pdfPageIndexsA
  44. destDocType:(NSString *)destDocTypeA
  45. destDocPath:(NSString *)destDocPathA
  46. moreOptions:(NSDictionary*)moreOptionsA;
  47. - (void)convertPDFAtPath:(NSString *)pdfPathA
  48. pdfPassword:(NSString *)pdfPasswordA
  49. pdfPageIndexs:(NSArray *)pdfPageIndexsA
  50. destDocType:(NSString *)destDocTypeA
  51. destDocPath:(NSString *)destDocPathA
  52. moreOptions:(NSDictionary *)moreOptionsA;
  53. @end
  54. NS_ASSUME_NONNULL_END