CPDFDestination.h 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. //
  2. // CPDFDestination.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 CPDFDocument;
  14. /**
  15. * A CPDFDestination object describes a point on a PDF page.
  16. *
  17. * @discussion In typical usage, you do not initialize CPDFDestination objects but rather get them as either attributes of CPDFLinkAnnotation or CPDFOutline objects,
  18. * or in response to the CPDFView method currentDestination.
  19. */
  20. @interface CPDFDestination : NSObject
  21. #pragma mark - Initializers
  22. /**
  23. * Initializes the destination.
  24. *
  25. * @discussion Specify point in page space. Typically, there’s no need to initialize destinations. Instead, you get them from CPDFLinkAnnotation, CPDFOutline, or CPDFView objects.
  26. * @param document The document with which the destination is associated.
  27. * @param pageIndex The page index of the destination.
  28. */
  29. - (instancetype)initWithDocument:(CPDFDocument *)document
  30. pageIndex:(NSInteger)pageIndex;
  31. /**
  32. * Initializes the destination.
  33. *
  34. * @discussion Specify point in page space. Typically, there’s no need to initialize destinations. Instead, you get them from CPDFLinkAnnotation, CPDFOutline, or CPDFView objects.
  35. * Page space is a coordinate system with the origin at the lower-left corner of the current page.
  36. * @param document The document with which the destination is associated.
  37. * @param pageIndex The page index of the destination.
  38. * @param point The point of the destination, in page space.
  39. * @param zoom The zoom of the destination.
  40. */
  41. - (instancetype)initWithDocument:(CPDFDocument *)document
  42. pageIndex:(NSInteger)pageIndex
  43. atPoint:(CGPoint)point
  44. zoom:(CGFloat)zoom;
  45. #pragma mark - Accessors
  46. /**
  47. * Returns the document with which the destination is associated.
  48. */
  49. @property (nonatomic,readonly) CPDFDocument *document;
  50. /**
  51. * Returns the page index that the destination refers to.
  52. */
  53. @property (nonatomic,readonly) NSInteger pageIndex;
  54. /**
  55. * Returns the point, in page space, that the destination refers to.
  56. *
  57. * @discussion Page space is a coordinate system with the origin at the lower-left corner of the current page.
  58. */
  59. @property (nonatomic,readonly) CGPoint point;
  60. /**
  61. * Returns the scale factor the PDF viewer should assume for this destination.
  62. */
  63. @property (nonatomic,readonly) CGFloat zoom;
  64. @end