CPDFCompareContent.h 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. //
  2. // CPDFCompareContent.h
  3. // ComPDFKit
  4. //
  5. // Copyright © 2014-2023 PDF Technologies, Inc. All Rights Reserved.
  6. //
  7. // THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
  8. // AND MAY NOT BE RESOLD OR REDISTRIBUTED. USAGE IS BOUND TO THE ComPDFKit LICENSE AGREEMENT.
  9. // UNAUTHORIZED REPRODUCTION OR DISTRIBUTION IS SUBJECT TO CIVIL AND CRIMINAL PENALTIES.
  10. // This notice may not be removed from this file.
  11. //
  12. #import <ComPDFKit/CPDFKitPlatform.h>
  13. #import "CPDFCompareResults.h"
  14. typedef NS_ENUM(NSInteger, CPDFCompareType) {
  15. CPDFCompareTypeText = 0,
  16. CPDFCompareTypeImage,
  17. CPDFCompareTypeAll
  18. };
  19. @class CPDFDocument;
  20. @interface CPDFCompareContent : NSObject
  21. /**
  22. * Initialize it with the given two versions of a document.
  23. * By default, it will generate a comparison document according to the order of pages, starting from the first page of both versions of the document.
  24. *
  25. * @param oldDocument The old version of a document
  26. * @param newDocument The new version of a document.
  27. */
  28. - (instancetype)initWithOldDocument:(CPDFDocument *)oldDocument
  29. newDocument:(CPDFDocument *)newDocument;
  30. /**
  31. * Specifies pages and types to compare.
  32. */
  33. - (CPDFCompareResults *)compareOldPageIndex:(NSInteger)oldPageIndex
  34. newPageIndex:(NSInteger)newPageIndex
  35. type:(CPDFCompareType)type
  36. isDrawHighlight:(BOOL)isDrawHighlight;
  37. /**
  38. * Sets to replace the highlight color.
  39. */
  40. - (void)setReplaceColor:(CPDFKitPlatformColor *)color;
  41. /**
  42. * Sets the opacity of the replace highlighted color
  43. */
  44. - (void)setReplaceOpacity:(CGFloat)opacity;
  45. /**
  46. * Sets to insert the highlight color.
  47. */
  48. - (void)setInsertColor:(CPDFKitPlatformColor *)color;
  49. /**
  50. * Sets the opacity of the insert highlighted color
  51. */
  52. - (void)setInsertOpacity:(CGFloat)opacity;
  53. /**
  54. * Sets to remove the highlight color.
  55. */
  56. - (void)setDeleteColor:(CPDFKitPlatformColor *)color;
  57. /**
  58. * Sets the opacity of the remove highlighted color
  59. */
  60. - (void)setDeleteOpacity:(CGFloat)opacity;
  61. /**
  62. * Saves the comparison document.
  63. */
  64. - (BOOL)saveAsComparisonDocumentWithFilePath:(NSString *)filePath;
  65. @end