CPDFSelection.h 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. //
  2. // CPDFSelection.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. @class CPDFPage;
  14. /**
  15. * A CPDFSelection object identifies a contiguous or noncontiguous selection of text in a PDF document.
  16. */
  17. @interface CPDFSelection : NSObject
  18. #pragma mark - Accessors
  19. /**
  20. * Returns the page where the selection is located.
  21. */
  22. @property (nonatomic,readonly) CPDFPage *page;
  23. /**
  24. * Returns the bounds of the selection on the page.
  25. *
  26. * @discussion The selection rectangle is given in page space. Page space is a coordinate system with the origin at the lower-left corner of the current page.
  27. */
  28. @property (nonatomic,readonly) CGRect bounds;
  29. /**
  30. * Returns a range of contiguous text on the page.
  31. */
  32. @property (nonatomic,readonly) NSRange range;
  33. /**
  34. * Returns an array of selections, one for each line of text covered by the receiver.
  35. *
  36. * @discussion If you call this method on a CPDFSelection object that represents a paragraph, for example,
  37. * selectionsByLine returns an array that contains one CPDFSelection object for each line of text in the paragraph.
  38. */
  39. @property (nonatomic,readonly) NSArray<CPDFSelection *> *selectionsByLine;
  40. /**
  41. * Returns an NSString object representing the text contained in the selection (may contain linefeed characters).
  42. */
  43. - (NSString *)string;
  44. @end