CPDFBackground.h 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. //
  2. // CPDFBackground.h
  3. // ComPDFKit
  4. //
  5. // Copyright © 2014-2022 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. typedef NS_ENUM(NSInteger, CPDFBackgroundType) {
  14. CPDFBackgroundTypeColor = 0,
  15. CPDFBackgroundTypeImage
  16. };
  17. /**
  18. * Adds and removes the background.
  19. */
  20. @interface CPDFBackground : NSObject
  21. #pragma mark - Accessors
  22. /**
  23. * Method to get / set the type of the background.
  24. *
  25. * @see CPDFBackgroundType
  26. */
  27. @property (nonatomic,assign) CPDFBackgroundType type;
  28. /**
  29. * Method to get / set the color of the background.
  30. */
  31. @property (nonatomic,retain) CPDFKitPlatformColor *color;
  32. /**
  33. * Method to get / set the scale of the background.
  34. */
  35. @property (nonatomic,assign) CGFloat scale;
  36. /**
  37. * Method to get / set the rotation angle of the background.
  38. */
  39. @property (nonatomic,assign) CGFloat rotation;
  40. /**
  41. * Method to get / set the opacity of the background.
  42. */
  43. @property (nonatomic,assign) CGFloat opacity;
  44. /**
  45. * Method to get / set the page range of the background by string, such as "0,3,5-7".
  46. */
  47. @property (nonatomic,retain) NSString *pageString;
  48. /**
  49. * Method to get / set the vertical alignment of the background.
  50. */
  51. @property (nonatomic,assign) NSUInteger verticalAlignment;
  52. /**
  53. * Method to get / set the horizontal offset of the background.
  54. */
  55. @property (nonatomic,assign) NSUInteger horizontalAlignment;
  56. /**
  57. * Method to get / set the horizontal offset of the background.
  58. */
  59. @property (nonatomic,assign) CGFloat xOffset;
  60. /**
  61. * Method to get / set the vertical offset of the background.
  62. */
  63. @property (nonatomic,assign) CGFloat yOffset;
  64. /**
  65. * Method to get / set whether to support the background to be displayed.
  66. */
  67. @property (nonatomic,assign) BOOL isAllowsView;
  68. /**
  69. * Method to get / set whether to support the background to be printed.
  70. */
  71. @property (nonatomic,assign) BOOL isAllowsPrint;
  72. /**
  73. * Sets the image of the background.
  74. */
  75. - (void)setImage:(CPDFKitPlatformImage *)image;
  76. /**
  77. * Updates the background.
  78. */
  79. - (void)update;
  80. /**
  81. * Removes the background.
  82. */
  83. - (void)clear;
  84. @end