CStampFileManger.h 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. //
  2. // CStampFileManger.h
  3. // ComPDFKit_Tools
  4. //
  5. // Copyright © 2014-2024 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 <UIKit/UIKit.h>
  13. NS_ASSUME_NONNULL_BEGIN
  14. #define kPDFStampDataFolder [NSHomeDirectory() stringByAppendingPathComponent:@"Library/PDFKitResources/Stamp"]
  15. #define kPDFStampTextList [NSHomeDirectory() stringByAppendingPathComponent:@"Library/PDFKitResources/Stamp/stamp_text.plist"]
  16. #define kPDFStampImageList [NSHomeDirectory() stringByAppendingPathComponent:@"Library/PDFKitResources/Stamp/stamp_image.plist"]
  17. typedef enum : NSUInteger {
  18. PDFStampCustomType_Text,
  19. PDFStampCustomType_Image,
  20. } PDFStampCustomType;
  21. @interface CStampFileManger : NSObject
  22. @property (nonatomic, strong) NSMutableArray *stampTextList;
  23. @property (nonatomic, strong) NSMutableArray<NSDictionary *> *stampImageList;
  24. @property (nonatomic, strong) NSMutableArray *deleteList;
  25. - (void)readStampDataFromFile;
  26. - (NSArray *)getTextStampData;
  27. - (NSArray *)getImageStampData;
  28. - (BOOL)saveStampDataToFile:(PDFStampCustomType)stampType;
  29. - (BOOL)insertStampItem:(NSDictionary *)stampItem type:(PDFStampCustomType)stampType;
  30. - (BOOL)removeStampItem:(NSInteger)index type:(PDFStampCustomType)stampType;
  31. - (NSString *)saveStampWithImage:(UIImage *)image;
  32. @end
  33. NS_ASSUME_NONNULL_END