Explorar el Código

PDFTools(iOS)-stamp注释UI已经交互

yangliuhua hace 1 año
padre
commit
18783b1562
Se han modificado 25 ficheros con 1775 adiciones y 16 borrados
  1. 33 1
      compdfkit-tools/compdfkit-tools.xcodeproj/project.pbxproj
  2. 2 2
      compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFShape/CPDFShapeArrowViewController.m
  3. 35 0
      compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFStamp/CCustomizeStampTableViewCell.h
  4. 65 0
      compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFStamp/CCustomizeStampTableViewCell.m
  5. 4 0
      compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFStamp/CPDFStampViewController.h
  6. 205 8
      compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFStamp/CPDFStampViewController.m
  7. 48 0
      compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFStamp/CStampPreview.h
  8. 445 0
      compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFStamp/CStampPreview.m
  9. 33 0
      compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFStamp/CStampShapView.h
  10. 92 0
      compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFStamp/CStampShapView.m
  11. 21 0
      compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFStamp/CStampTextViewController.h
  12. 267 0
      compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFStamp/CStampTextViewController.m
  13. 12 0
      compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFStamp/Image.xcassets/CPDFStampTextImageCenter.imageset/Contents.json
  14. 77 0
      compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFStamp/Image.xcassets/CPDFStampTextImageCenter.imageset/With Label.pdf
  15. 12 0
      compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFStamp/Image.xcassets/CPDFStampTextImageLeft.imageset/Contents.json
  16. 154 0
      compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFStamp/Image.xcassets/CPDFStampTextImageLeft.imageset/With Label (1).pdf
  17. 12 0
      compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFStamp/Image.xcassets/CPDFStampTextImageNone.imageset/Contents.json
  18. 71 0
      compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFStamp/Image.xcassets/CPDFStampTextImageNone.imageset/With Label (3).pdf
  19. 12 0
      compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFStamp/Image.xcassets/CPDFStampTextImageRight.imageset/Contents.json
  20. 170 0
      compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFStamp/Image.xcassets/CPDFStampTextImageRight.imageset/With Label (2).pdf
  21. 2 1
      compdfkit-tools/compdfkit-tools/Common/Views/PDFAnnotationBar/CPDFAnnotationBar.m
  22. 1 1
      compdfkit-tools/compdfkit-tools/Common/Views/PDFProperties/CPDFColorSelectView.m
  23. 1 1
      compdfkit-tools/compdfkit-tools/Common/Views/PDFProperties/CPDFOpacitySliderView.m
  24. 1 1
      compdfkit-tools/compdfkit-tools/Common/Views/PDFProperties/CPDFThicknessSliderView.m
  25. 0 1
      compdfkit-tools/compdfkit-tools/compdfkit_tools.h

+ 33 - 1
compdfkit-tools/compdfkit-tools.xcodeproj/project.pbxproj

@@ -115,7 +115,7 @@
 		C9AF189C29F4DBF800EC4979 /* CPDFOpacitySliderView.m in Sources */ = {isa = PBXBuildFile; fileRef = C9AF189A29F4DBF800EC4979 /* CPDFOpacitySliderView.m */; };
 		C9B9EC4A29F4DC8900C6A5D2 /* CPDFThicknessSliderView.h in Headers */ = {isa = PBXBuildFile; fileRef = C9B9EC4829F4DC8900C6A5D2 /* CPDFThicknessSliderView.h */; };
 		C9B9EC4B29F4DC8900C6A5D2 /* CPDFThicknessSliderView.m in Sources */ = {isa = PBXBuildFile; fileRef = C9B9EC4929F4DC8900C6A5D2 /* CPDFThicknessSliderView.m */; };
-		C9B9EC4E29F52DBF00C6A5D2 /* AAPLCustomPresentationController.h in Headers */ = {isa = PBXBuildFile; fileRef = C9B9EC4D29F52DBF00C6A5D2 /* AAPLCustomPresentationController.h */; settings = {ATTRIBUTES = (Public, ); }; };
+		C9B9EC4E29F52DBF00C6A5D2 /* AAPLCustomPresentationController.h in Headers */ = {isa = PBXBuildFile; fileRef = C9B9EC4D29F52DBF00C6A5D2 /* AAPLCustomPresentationController.h */; };
 		C9B9EC5029F52DCC00C6A5D2 /* AAPLCustomPresentationController.m in Sources */ = {isa = PBXBuildFile; fileRef = C9B9EC4F29F52DCC00C6A5D2 /* AAPLCustomPresentationController.m */; };
 		C9B9EC5929F54E9600C6A5D2 /* CAnnotStyle.h in Headers */ = {isa = PBXBuildFile; fileRef = C9B9EC5729F54E9600C6A5D2 /* CAnnotStyle.h */; };
 		C9B9EC5A29F54E9600C6A5D2 /* CAnnotStyle.m in Sources */ = {isa = PBXBuildFile; fileRef = C9B9EC5829F54E9600C6A5D2 /* CAnnotStyle.m */; };
@@ -128,6 +128,14 @@
 		C9FBA21C2A0E2FB6003FABEC /* CStampButton.h in Headers */ = {isa = PBXBuildFile; fileRef = C9FBA21A2A0E2FB6003FABEC /* CStampButton.h */; };
 		C9FBA21D2A0E2FB6003FABEC /* CStampButton.m in Sources */ = {isa = PBXBuildFile; fileRef = C9FBA21B2A0E2FB6003FABEC /* CStampButton.m */; };
 		F32054B52A0F2A7A006B41F7 /* NavigationRightImage.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = F32054B42A0F2A7A006B41F7 /* NavigationRightImage.xcassets */; };
+		C9FBA2202A0F2911003FABEC /* CStampTextViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = C9FBA21E2A0F2911003FABEC /* CStampTextViewController.h */; };
+		C9FBA2212A0F2911003FABEC /* CStampTextViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = C9FBA21F2A0F2911003FABEC /* CStampTextViewController.m */; };
+		C9FBA2242A0F2BE0003FABEC /* CStampPreview.h in Headers */ = {isa = PBXBuildFile; fileRef = C9FBA2222A0F2BE0003FABEC /* CStampPreview.h */; };
+		C9FBA2252A0F2BE0003FABEC /* CStampPreview.m in Sources */ = {isa = PBXBuildFile; fileRef = C9FBA2232A0F2BE0003FABEC /* CStampPreview.m */; };
+		C9FBA22C2A0F5937003FABEC /* CStampShapView.h in Headers */ = {isa = PBXBuildFile; fileRef = C9FBA22A2A0F5937003FABEC /* CStampShapView.h */; };
+		C9FBA22D2A0F5937003FABEC /* CStampShapView.m in Sources */ = {isa = PBXBuildFile; fileRef = C9FBA22B2A0F5937003FABEC /* CStampShapView.m */; };
+		C9FBA2302A10CBDA003FABEC /* CCustomizeStampTableViewCell.h in Headers */ = {isa = PBXBuildFile; fileRef = C9FBA22E2A10CBDA003FABEC /* CCustomizeStampTableViewCell.h */; };
+		C9FBA2312A10CBDA003FABEC /* CCustomizeStampTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = C9FBA22F2A10CBDA003FABEC /* CCustomizeStampTableViewCell.m */; };
 		F32DA16229ED904300E19ECA /* CPDFOutlineModel.h in Headers */ = {isa = PBXBuildFile; fileRef = F32DA12229ED904300E19ECA /* CPDFOutlineModel.h */; };
 		F32DA16329ED904300E19ECA /* Image.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = F32DA12329ED904300E19ECA /* Image.xcassets */; };
 		F32DA16429ED904300E19ECA /* CPDFOutlineViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = F32DA12429ED904300E19ECA /* CPDFOutlineViewCell.m */; };
@@ -343,6 +351,14 @@
 		C9FBA2182A0DD277003FABEC /* Image.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Image.xcassets; sourceTree = "<group>"; };
 		C9FBA21A2A0E2FB6003FABEC /* CStampButton.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CStampButton.h; sourceTree = "<group>"; };
 		C9FBA21B2A0E2FB6003FABEC /* CStampButton.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = CStampButton.m; sourceTree = "<group>"; };
+		C9FBA21E2A0F2911003FABEC /* CStampTextViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CStampTextViewController.h; sourceTree = "<group>"; };
+		C9FBA21F2A0F2911003FABEC /* CStampTextViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = CStampTextViewController.m; sourceTree = "<group>"; };
+		C9FBA2222A0F2BE0003FABEC /* CStampPreview.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CStampPreview.h; sourceTree = "<group>"; };
+		C9FBA2232A0F2BE0003FABEC /* CStampPreview.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = CStampPreview.m; sourceTree = "<group>"; };
+		C9FBA22A2A0F5937003FABEC /* CStampShapView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CStampShapView.h; sourceTree = "<group>"; };
+		C9FBA22B2A0F5937003FABEC /* CStampShapView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = CStampShapView.m; sourceTree = "<group>"; };
+		C9FBA22E2A10CBDA003FABEC /* CCustomizeStampTableViewCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CCustomizeStampTableViewCell.h; sourceTree = "<group>"; };
+		C9FBA22F2A10CBDA003FABEC /* CCustomizeStampTableViewCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = CCustomizeStampTableViewCell.m; sourceTree = "<group>"; };
 		F313657129E4367A00EE6BBB /* ComPDFKit.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = ComPDFKit.xcframework; path = ../Lib/ComPDFKit.xcframework; sourceTree = "<group>"; };
 		F32054B42A0F2A7A006B41F7 /* NavigationRightImage.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = NavigationRightImage.xcassets; sourceTree = "<group>"; };
 		F32DA12229ED904300E19ECA /* CPDFOutlineModel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CPDFOutlineModel.h; sourceTree = "<group>"; };
@@ -770,10 +786,18 @@
 				C9FBA20D2A0D1119003FABEC /* CPDFStampViewController.m */,
 				C9FBA2102A0D1172003FABEC /* CStampCollectionViewCell.h */,
 				C9FBA2112A0D1172003FABEC /* CStampCollectionViewCell.m */,
+				C9FBA21E2A0F2911003FABEC /* CStampTextViewController.h */,
+				C9FBA21F2A0F2911003FABEC /* CStampTextViewController.m */,
 				C9FBA2142A0D11C7003FABEC /* CStampFileManger.h */,
 				C9FBA2152A0D11C7003FABEC /* CStampFileManger.m */,
 				C9FBA21A2A0E2FB6003FABEC /* CStampButton.h */,
 				C9FBA21B2A0E2FB6003FABEC /* CStampButton.m */,
+				C9FBA2222A0F2BE0003FABEC /* CStampPreview.h */,
+				C9FBA2232A0F2BE0003FABEC /* CStampPreview.m */,
+				C9FBA22A2A0F5937003FABEC /* CStampShapView.h */,
+				C9FBA22B2A0F5937003FABEC /* CStampShapView.m */,
+				C9FBA22E2A10CBDA003FABEC /* CCustomizeStampTableViewCell.h */,
+				C9FBA22F2A10CBDA003FABEC /* CCustomizeStampTableViewCell.m */,
 				C9FBA2182A0DD277003FABEC /* Image.xcassets */,
 			);
 			path = PDFStamp;
@@ -1132,6 +1156,7 @@
 				4FD34DD02A0B3F51005CEAB6 /* CPDFPopMenu.h in Headers */,
 				4F6C796A29FBD532008C9501 /* CPDFEditFontNameSelectView.h in Headers */,
 				C91BE7CD2A037A490038F2BC /* CPDFInkTopToolBar.h in Headers */,
+				C9FBA2302A10CBDA003FABEC /* CCustomizeStampTableViewCell.h in Headers */,
 				C918CEA529F8FC1800D43974 /* CPDFUnderlineViewController.h in Headers */,
 				C91BE7E22A048F1A0038F2BC /* CSignatureManager.h in Headers */,
 				F35DD19F2A06850700B57F5B /* CPDFCircleAnnotation+PDFListView.h in Headers */,
@@ -1147,6 +1172,7 @@
 				4F7D57EF2A0D0D76008C76D3 /* CPDFToolsViewController.h in Headers */,
 				F32DA17029ED904300E19ECA /* CPDFThumbnailViewCell.h in Headers */,
 				4FD34DCB2A0B2752005CEAB6 /* CNavigationBarTitleButton.h in Headers */,
+				C9FBA2202A0F2911003FABEC /* CStampTextViewController.h in Headers */,
 				4FD34DDC2A0B6532005CEAB6 /* CPDFPopMenuView.h in Headers */,
 				C9AF189729F4DA6A00EC4979 /* CPDFColorSelectView.h in Headers */,
 				F35DD19C2A06850700B57F5B /* CPDFAnnotationHeader.h in Headers */,
@@ -1177,12 +1203,14 @@
 				C91BE7EE2A04AED50038F2BC /* CSignatureDrawView.h in Headers */,
 				C918CEDF29FB943400D43974 /* CPDFArrowStyleCell.h in Headers */,
 				4FD34DE12A0B677E005CEAB6 /* CPDFPopMenuItem.h in Headers */,
+				C9FBA2242A0F2BE0003FABEC /* CStampPreview.h in Headers */,
 				F32DA17829ED904300E19ECA /* CPDFDisplayTableViewCell.h in Headers */,
 				C9B9EC4E29F52DBF00C6A5D2 /* AAPLCustomPresentationController.h in Headers */,
 				C91BE7D42A039AC40038F2BC /* CPDFSignatureViewController.h in Headers */,
 				F32DA17129ED904300E19ECA /* CPDFThumbnailViewController.h in Headers */,
 				C9B9EC5929F54E9600C6A5D2 /* CAnnotStyle.h in Headers */,
 				F35DD18A2A067E7500B57F5B /* CPDFListView+UndoManager.h in Headers */,
+				C9FBA22C2A0F5937003FABEC /* CStampShapView.h in Headers */,
 				C91BE7DC2A039E900038F2BC /* CPDFSignatureEditViewController.h in Headers */,
 				F35DD19E2A06850700B57F5B /* CPDFFreeTextAnnotation+PDFListView.h in Headers */,
 				F32DA16229ED904300E19ECA /* CPDFOutlineModel.h in Headers */,
@@ -1320,6 +1348,8 @@
 				F382636A29EFD0D9003F1DFD /* CPDFSlider.m in Sources */,
 				4F06AB5029F6792E007797E4 /* CPDFTextProperty.m in Sources */,
 				C9AF189C29F4DBF800EC4979 /* CPDFOpacitySliderView.m in Sources */,
+				C9FBA22D2A0F5937003FABEC /* CStampShapView.m in Sources */,
+				C9FBA2212A0F2911003FABEC /* CStampTextViewController.m in Sources */,
 				C9AF189329F4D0F300EC4979 /* CPDFAnnotationSampleView.m in Sources */,
 				F32DA16629ED904300E19ECA /* CPDFOutlineModel.m in Sources */,
 				F32DA16729ED904300E19ECA /* CPDFOutlineViewController.m in Sources */,
@@ -1351,6 +1381,7 @@
 				F35DD1A12A06850700B57F5B /* CPDFSquareAnnotation+PDFListView.m in Sources */,
 				F32DA17729ED904300E19ECA /* CPDFInfoTableCell.m in Sources */,
 				4F1131B029F8EEA800950564 /* CPDFEditViewController.m in Sources */,
+				C9FBA2312A10CBDA003FABEC /* CCustomizeStampTableViewCell.m in Sources */,
 				C918CED529FA972300D43974 /* CPDFShapeArrowViewController.m in Sources */,
 				F32DA16B29ED904300E19ECA /* CSearchToolbar.m in Sources */,
 				C918CEC429FA0C7700D43974 /* CPDFSquigglyViewController.m in Sources */,
@@ -1365,6 +1396,7 @@
 				C91BE7D52A039AC40038F2BC /* CPDFSignatureViewController.m in Sources */,
 				C918CE9C29F8EE7200D43974 /* CPDFHighlightViewController.m in Sources */,
 				C918CEE029FB943400D43974 /* CPDFArrowStyleCell.m in Sources */,
+				C9FBA2252A0F2BE0003FABEC /* CStampPreview.m in Sources */,
 				C9AF189829F4DA6A00EC4979 /* CPDFColorSelectView.m in Sources */,
 				C9AF182D29EFB1FC00EC4979 /* CPDFBookmarkViewCell.m in Sources */,
 				C9AF188F29F4C8A900EC4979 /* CPDFAnnotationBaseViewController.m in Sources */,

+ 2 - 2
compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFShape/CPDFShapeArrowViewController.m

@@ -40,7 +40,7 @@
     [super viewDidLoad];
     // Do any additional setup after loading the view.
     self.arrowLabel = [[UILabel alloc] init];
-    self.arrowLabel.text = @"Arrow Style";
+    self.arrowLabel.text = NSLocalizedString(@"Arrow Style", nil);
     self.arrowLabel.textColor = [UIColor grayColor];
     self.arrowLabel.font = [UIFont systemFontOfSize:12.0];
     [self.scrcollView addSubview:self.arrowLabel];
@@ -52,7 +52,7 @@
     [self.scrcollView addSubview:self.arrowBtn];
     
     self.trialLabel = [[UILabel alloc] init];
-    self.trialLabel.text = @"Arrowtail style";
+    self.trialLabel.text = NSLocalizedString(@"Arrowtail style", nil);
     self.trialLabel.textColor = [UIColor grayColor];
     self.trialLabel.font = [UIFont systemFontOfSize:12.0];
     self.trialLabel.autoresizingMask = UIViewAutoresizingFlexibleRightMargin;

+ 35 - 0
compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFStamp/CCustomizeStampTableViewCell.h

@@ -0,0 +1,35 @@
+//
+//  CStampCustomizeTableViewCell.h
+//  compdfkit-tools
+//
+//  Copyright © 2014-2023 PDF Technologies, Inc. All Rights Reserved.
+//
+//  THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
+//  AND MAY NOT BE RESOLD OR REDISTRIBUTED. USAGE IS BOUND TO THE ComPDFKit LICENSE AGREEMENT.
+//  UNAUTHORIZED REPRODUCTION OR DISTRIBUTION IS SUBJECT TO CIVIL AND CRIMINAL PENALTIES.
+//  This notice may not be removed from this file.
+//
+
+#import <UIKit/UIKit.h>
+
+NS_ASSUME_NONNULL_BEGIN
+
+@class CCustomizeStampTableViewCell;
+
+@protocol CCustomizeStampTableViewCellDelegate <NSObject>
+
+@optional
+
+- (void)customizeStampTableViewCell:(CCustomizeStampTableViewCell *)customizeStampTableViewCell;
+
+@end
+
+@interface CCustomizeStampTableViewCell : UITableViewCell
+
+@property (nonatomic, strong) UIImageView *customizeStampImageView;
+
+@property (nonatomic, weak) id<CCustomizeStampTableViewCellDelegate> deleteDelegate;
+
+@end
+
+NS_ASSUME_NONNULL_END

+ 65 - 0
compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFStamp/CCustomizeStampTableViewCell.m

@@ -0,0 +1,65 @@
+//
+//  CStampCustomizeTableViewCell.m
+//  compdfkit-tools
+//
+//  Copyright © 2014-2023 PDF Technologies, Inc. All Rights Reserved.
+//
+//  THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
+//  AND MAY NOT BE RESOLD OR REDISTRIBUTED. USAGE IS BOUND TO THE ComPDFKit LICENSE AGREEMENT.
+//  UNAUTHORIZED REPRODUCTION OR DISTRIBUTION IS SUBJECT TO CIVIL AND CRIMINAL PENALTIES.
+//  This notice may not be removed from this file.
+//
+
+#import "CCustomizeStampTableViewCell.h"
+
+@interface CCustomizeStampTableViewCell ()
+
+@property (nonatomic, strong) UIButton *deleteButton;
+
+@end
+
+@implementation CCustomizeStampTableViewCell
+
+- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
+    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
+        self.customizeStampImageView = [[UIImageView alloc] init];
+        [self.contentView addSubview:self.customizeStampImageView];
+        
+        self.deleteButton = [[UIButton alloc] init];
+        [self.deleteButton setImage:[UIImage imageNamed:@"CPDFSignatureImageDelete" inBundle:[NSBundle bundleForClass:self.class] compatibleWithTraitCollection:nil] forState:UIControlStateNormal];
+        [self.deleteButton addTarget:self action:@selector(buttonItemClicked_delete:) forControlEvents:UIControlEventTouchUpInside];
+        [self.contentView addSubview:self.deleteButton];
+    }
+    return self;
+}
+
+- (void)layoutSubviews {
+    [super layoutSubviews];
+    CGFloat height = self.contentView.bounds.size.height;
+    CGFloat width  = height * self.customizeStampImageView.image.size.width / self.customizeStampImageView.image.size.height;
+    width = MIN(width, self.contentView.bounds.size.width - 80.0);
+    [self.customizeStampImageView setFrame:CGRectMake((self.bounds.size.width - width)/2.0, 0.0, width, height)];
+    self.customizeStampImageView.center = self.contentView.center;
+    self.deleteButton.frame = CGRectMake(self.bounds.size.width - 50, 0.0, 50, 50);
+}
+
+#pragma mark - Action
+
+- (void)buttonItemClicked_delete:(id)sender {
+    if (self.deleteDelegate && [self.deleteDelegate respondsToSelector:@selector(customizeStampTableViewCell:)]) {
+        [self.deleteDelegate customizeStampTableViewCell:self];
+    }
+}
+
+- (void)awakeFromNib {
+    [super awakeFromNib];
+    // Initialization code
+}
+
+- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
+    [super setSelected:selected animated:animated];
+
+    // Configure the view for the selected state
+}
+
+@end

+ 4 - 0
compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFStamp/CPDFStampViewController.h

@@ -32,10 +32,14 @@ extern PDFAnnotationStampKey PDFAnnotationStampKeyShape;       // NSIntger
 
 - (void)stampViewController:(CPDFStampViewController *)stampViewController selectedInde:(NSInteger)selectedIndex stamp:(NSDictionary *)stamp;
 
+- (void)stampViewController:(CPDFStampViewController *)stampViewController;
+
 @end
 
 @interface CPDFStampViewController : UIViewController
 
+@property (nonatomic, weak) id<CPDFStampViewControllerDelegate> delegate;
+
 @end
 
 NS_ASSUME_NONNULL_END

+ 205 - 8
compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFStamp/CPDFStampViewController.m

@@ -15,9 +15,15 @@
 #import "CStampCollectionViewCell.h"
 #import "CPDFColorUtils.h"
 #import "CStampButton.h"
+#import "CStampTextViewController.h"
+#import "AAPLCustomPresentationController.h"
+#import "CStampTextViewController.h"
+#import "CCustomizeStampTableViewCell.h"
 
 #import <ComPDFKit/ComPDFKit.h>
 
+#define kStamp_Cell_Height 60
+
 PDFAnnotationStampKey const PDFAnnotationStampKeyType = @"PDFAnnotationStampKeyType";
 PDFAnnotationStampKey const PDFAnnotationStampKeyImagePath = @"PDFAnnotationStampKeyImagePath";
 PDFAnnotationStampKey const PDFAnnotationStampKeyText = @"PDFAnnotationStampKeyText";
@@ -26,10 +32,12 @@ PDFAnnotationStampKey const PDFAnnotationStampKeyShowTime = @"PDFAnnotationStamp
 PDFAnnotationStampKey const PDFAnnotationStampKeyStyle = @"PDFAnnotationStampKeyStyle";
 PDFAnnotationStampKey const PDFAnnotationStampKeyShape = @"PDFAnnotationStampKeyShape";
 
-@interface CPDFStampViewController () <UICollectionViewDelegate, UICollectionViewDataSource>
+@interface CPDFStampViewController () <UICollectionViewDelegate, UICollectionViewDataSource, UIPopoverPresentationControllerDelegate, UINavigationControllerDelegate, UIImagePickerControllerDelegate, UITableViewDelegate, UITableViewDataSource>
 
 @property (nonatomic, strong) UICollectionView *collectView;
 
+@property (nonatomic, strong) UITableView *tableView;
+
 @property (nonatomic, strong) UISegmentedControl *segmentedControl;
 
 @property (nonatomic, strong) NSArray *standardArray;
@@ -56,6 +64,8 @@ PDFAnnotationStampKey const PDFAnnotationStampKeyShape = @"PDFAnnotationStampKey
 
 @property (nonatomic, strong) CStampButton *imageButton;
 
+@property (nonatomic, strong) UIView *modelView;
+
 @end
 
 @implementation CPDFStampViewController
@@ -121,14 +131,18 @@ PDFAnnotationStampKey const PDFAnnotationStampKeyShape = @"PDFAnnotationStampKey
     [super viewWillLayoutSubviews];
     self.titleLabel.frame = CGRectMake((self.view.frame.size.width - 120)/2, 5, 120, 50);
     self.segmentedControl.frame = CGRectMake(50, 50, self.view.frame.size.width-100, 30);
-    
     if (@available(iOS 11.0, *)) {
         self.backBtn.frame = CGRectMake(self.view.frame.size.width - 60 - self.view.safeAreaInsets.right, 5, 50, 50);
-        self.createButton.frame = CGRectMake(self.view.frame.size.width - 70 - self.view.safeAreaInsets.right, self.view.frame.size.height - 200 - self.view.safeAreaInsets.bottom, 50, 50);
+        self.createButton.frame = CGRectMake(self.view.frame.size.width - 70 - self.view.safeAreaInsets.right, self.view.bounds.size.height - 200 - self.view.safeAreaInsets.bottom, 50, 50);
+        self.textButton.frame = CGRectMake(self.view.frame.size.width - 180 - self.view.safeAreaInsets.right, self.view.bounds.size.height - 320 - self.view.safeAreaInsets.bottom, 160, 40);
+        self.imageButton.frame = CGRectMake(self.view.frame.size.width - 180 - self.view.safeAreaInsets.right, self.view.bounds.size.height - 270 - self.view.safeAreaInsets.bottom, 160, 40);
     } else {
         self.backBtn.frame = CGRectMake(self.view.frame.size.width - 100, 5, 50, 50);
         self.createButton.frame = CGRectMake(self.view.frame.size.width - 70, self.view.frame.size.height - 100, 50, 50);
+        self.textButton.frame = CGRectMake(self.view.frame.size.width - 70, self.view.frame.size.height - 220, 160, 40);
+        self.imageButton.frame = CGRectMake(self.view.frame.size.width - 70, self.view.frame.size.height - 170, 160, 40);
     }
+    self.modelView.frame = CGRectMake(0, -200, self.view.bounds.size.width, self.view.bounds.size.height+200);
 }
 
 - (void)viewWillAppear:(BOOL)animated {
@@ -145,7 +159,7 @@ PDFAnnotationStampKey const PDFAnnotationStampKeyShape = @"PDFAnnotationStampKey
 #pragma mark - Private Methods
 
 - (void)createStandardView {
-    self.standardView = [[UIView alloc] initWithFrame:CGRectMake(0, 100, self.view.bounds.size.width, self.view.bounds.size.height)];
+    self.standardView = [[UIView alloc] initWithFrame:CGRectMake(0, 100, self.view.bounds.size.width, self.view.bounds.size.height-100)];
     self.standardView.autoresizingMask = UIViewAutoresizingFlexibleWidth|UIViewAutoresizingFlexibleHeight;
     [self.view addSubview:self.standardView];
     
@@ -182,6 +196,18 @@ PDFAnnotationStampKey const PDFAnnotationStampKeyShape = @"PDFAnnotationStampKey
     [self.view addSubview:self.customizeView];
     self.customizeView.hidden = YES;
     
+    self.tableView = [[UITableView alloc] initWithFrame:self.view.bounds style:UITableViewStyleGrouped];
+    self.tableView.delegate = self;
+    self.tableView.dataSource = self;
+    self.tableView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
+    self.tableView.rowHeight = 100;
+    [self.customizeView addSubview:self.tableView];
+    
+    self.modelView = [[UIView alloc] init];
+    self.modelView.backgroundColor = [UIColor colorWithRed:0 green:0 blue:0 alpha:0.5];
+    [self.customizeView addSubview:self.modelView];
+    self.modelView.hidden = YES;
+    
     self.createButton = [[UIButton alloc] init];
     self.createButton.layer.cornerRadius = 25.0;
     self.createButton.clipsToBounds = YES;
@@ -192,16 +218,28 @@ PDFAnnotationStampKey const PDFAnnotationStampKeyShape = @"PDFAnnotationStampKey
     
     self.textButton = [[CStampButton alloc] init];
     [self.textButton.stampBtn setImage:[UIImage imageNamed:@"CPDFStampImageText" inBundle:[NSBundle bundleForClass:self.class] compatibleWithTraitCollection:nil] forState:UIControlStateNormal];
-    self.textButton.titleLabel.text = NSLocalizedString(@"", nil);
+    self.textButton.titleLabel.text = NSLocalizedString(@"Text Stamp", nil);
     [self.textButton.stampBtn addTarget:self action:@selector(buttonItemClicked_text:) forControlEvents:UIControlEventTouchUpInside];
     [self.customizeView addSubview:self.textButton];
+    self.textButton.hidden = YES;
+    
+    self.imageButton = [[CStampButton alloc] init];
+    [self.imageButton.stampBtn setImage:[UIImage imageNamed:@"CPDFStampImageImage" inBundle:[NSBundle bundleForClass:self.class] compatibleWithTraitCollection:nil] forState:UIControlStateNormal];
+    self.imageButton.titleLabel.text = NSLocalizedString(@"Image Stamp", nil);
+    [self.imageButton.stampBtn addTarget:self action:@selector(buttonItemClicked_image:) forControlEvents:UIControlEventTouchUpInside];
+    [self.customizeView addSubview:self.imageButton];
+    self.imageButton.hidden = YES;
 }
 
 - (void)createGestureRecognizer {
     [self.createButton setUserInteractionEnabled:YES];
+    [self.modelView setUserInteractionEnabled:YES];
 
     UIPanGestureRecognizer *panRecognizer = [[UIPanGestureRecognizer alloc] initWithTarget:self action:@selector(panaddBookmarkBtn:)];
     [self.createButton addGestureRecognizer:panRecognizer];
+    
+    UITapGestureRecognizer *tapRecognizer = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(tapModelView:)];
+    [self.modelView addGestureRecognizer:tapRecognizer];
 }
 
 - (void)panaddBookmarkBtn:(UIPanGestureRecognizer *)gestureRecognizer {
@@ -214,10 +252,102 @@ PDFAnnotationStampKey const PDFAnnotationStampKeyShape = @"PDFAnnotationStampKey
     [gestureRecognizer setTranslation:CGPointZero inView:self.view];
 }
 
+- (void)tapModelView:(UIPanGestureRecognizer *)gestureRecognizer {
+    self.textButton.hidden = YES;
+    self.modelView.hidden = YES;
+    self.imageButton.hidden = YES;
+}
+
+- (void)createImageSignature {
+    UIAlertAction *cameraAction = [UIAlertAction actionWithTitle:NSLocalizedString(@"Use Camera", nil) style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
+        UIImagePickerController *imagePickerController = [[UIImagePickerController alloc] init];
+        imagePickerController.delegate = self;
+        imagePickerController.sourceType = UIImagePickerControllerSourceTypeCamera;
+        [self presentViewController:imagePickerController animated:YES completion:nil];
+    }];
+    
+    UIAlertAction *photoAction = [UIAlertAction actionWithTitle:NSLocalizedString(@"Photo Library", nil) style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
+        UIImagePickerController *imagePickerController = [[UIImagePickerController alloc] init];
+        imagePickerController.delegate = self;
+        imagePickerController.sourceType = UIImagePickerControllerSourceTypePhotoLibrary;
+        imagePickerController.allowsEditing = YES;
+        imagePickerController.modalPresentationStyle = UIModalPresentationPopover;
+        [self presentViewController:imagePickerController animated:YES completion:nil];
+    }];
+    
+    UIAlertAction *cancelAction = [UIAlertAction actionWithTitle:NSLocalizedString(@"Cancel", nil)
+                                                           style:UIAlertActionStyleCancel
+                                                         handler:nil];
+    
+    UIAlertController *actionSheet = [UIAlertController alertControllerWithTitle:nil
+                                                                         message:nil
+                                                                  preferredStyle:UIAlertControllerStyleActionSheet];
+    
+    [actionSheet addAction:cameraAction];
+    [actionSheet addAction:photoAction];
+    [actionSheet addAction:cancelAction];
+    actionSheet.modalPresentationStyle = UIModalPresentationPopover;
+    [self presentViewController:actionSheet animated:YES completion:nil];
+}
+
+- (UIImage *)compressImage:(UIImage *)image {
+    CGFloat maxWH = kStamp_Cell_Height;
+    if ([[UIScreen mainScreen] respondsToSelector:@selector(scale)])
+        maxWH *=[UIScreen mainScreen].scale;
+    CGFloat imageScale = 1.0;
+    if (image.size.width > maxWH || image.size.height>maxWH)
+        imageScale = MIN(maxWH / image.size.width, maxWH / image.size.height);
+    CGSize newSize = CGSizeMake(image.size.width * imageScale, image.size.height * imageScale);
+    UIGraphicsBeginImageContext(newSize);
+    [image drawInRect:CGRectMake(0, 0, newSize.width, newSize.height)];
+    UIImage* newImage = UIGraphicsGetImageFromCurrentImageContext();
+    UIGraphicsEndImageContext();
+    return newImage;
+}
+
+#pragma mark - UIImagePickerControllerDelegate
+
+- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info {
+    [picker dismissViewControllerAnimated:YES completion:nil];
+    UIImage *image = [info objectForKey:UIImagePickerControllerOriginalImage];
+    
+    UIImageOrientation imageOrientation = image.imageOrientation;
+    if (imageOrientation!=UIImageOrientationUp) {
+        UIGraphicsBeginImageContext(image.size);
+        [image drawInRect:CGRectMake(0, 0, image.size.width, image.size.height)];
+        image = UIGraphicsGetImageFromCurrentImageContext();
+        UIGraphicsEndImageContext();
+    }
+    
+    NSData *imageData = UIImagePNGRepresentation(image);
+    if (imageData == nil || [imageData length] <= 0) {
+        return;
+    }
+    image = [UIImage imageWithData:imageData];
+    
+    const CGFloat colorMasking[6] = {222, 255, 222, 255, 222, 255};
+    CGImageRef imageRef = CGImageCreateWithMaskingColors(image.CGImage, colorMasking);
+    if (imageRef) {
+        image = [UIImage imageWithCGImage:imageRef];
+        CGImageRelease(imageRef);
+    }
+    
+    NSString *tPath = [self.stampFileManager saveStampWithImage:image];
+    if (tPath) {
+        NSMutableDictionary *tStampItem = [[NSMutableDictionary alloc] init];
+        [tStampItem setObject:tPath forKey:@"path"];
+        [self.stampFileManager insertStampItem:tStampItem type:PDFStampCustomType_Image];
+    }
+}
+
+- (void)imagePickerControllerDidCancel:(UIImagePickerController *)picker {
+    [picker dismissViewControllerAnimated:YES completion:nil];
+}
+
 #pragma mark - Protect Methods
 
 - (void)updatePreferredContentSizeWithTraitCollection:(UITraitCollection *)traitCollection {
-    self.preferredContentSize = CGSizeMake(self.view.bounds.size.width, traitCollection.verticalSizeClass == UIUserInterfaceSizeClassCompact ? 370 : 800);
+    self.preferredContentSize = CGSizeMake(self.view.bounds.size.width, traitCollection.verticalSizeClass == UIUserInterfaceSizeClassCompact ? 370 : 850);
 }
 
 #pragma mark - Action
@@ -227,7 +357,9 @@ PDFAnnotationStampKey const PDFAnnotationStampKeyShape = @"PDFAnnotationStampKey
 }
 
 - (void)buttonItemClicked_create:(id)sender {
-    
+    self.textButton.hidden = !self.textButton.hidden;
+    self.modelView.hidden = !self.modelView.hidden;
+    self.imageButton.hidden = !self.imageButton.hidden;
 }
 
 - (void)segmentedControlValueChanged_singature:(id)sender {
@@ -241,11 +373,26 @@ PDFAnnotationStampKey const PDFAnnotationStampKeyShape = @"PDFAnnotationStampKey
 }
 
 - (void)buttonItemClicked_text:(id)sender {
+    self.textButton.hidden = YES;
+    self.modelView.hidden = YES;
+    self.imageButton.hidden = YES;
+    
+    AAPLCustomPresentationController *presentationController NS_VALID_UNTIL_END_OF_SCOPE;
+    CStampTextViewController *stampTextVC = [[CStampTextViewController alloc] init];
+    presentationController = [[AAPLCustomPresentationController alloc] initWithPresentedViewController:stampTextVC presentingViewController:self];
+    stampTextVC.transitioningDelegate = presentationController;
+    [self presentViewController:stampTextVC animated:YES completion:nil];
     
+    if (self.delegate && [self.delegate respondsToSelector:@selector(stampViewController:)]) {
+        [self.delegate stampViewController:self];
+    }
 }
 
 - (void)buttonItemClicked_image:(id)sender {
-    
+    self.textButton.hidden = YES;
+    self.modelView.hidden = YES;
+    self.imageButton.hidden = YES;
+    [self createImageSignature];
 }
 
 #pragma mark - UICollectionViewDataSource
@@ -265,4 +412,54 @@ PDFAnnotationStampKey const PDFAnnotationStampKeyShape = @"PDFAnnotationStampKey
     return cell;
 }
 
+#pragma mark - UITableViewDataSource
+
+- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
+    return 2;
+}
+
+- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
+    switch (section) {
+        case 0:
+        {
+            return self.customTextArray.count;
+        }
+            break;
+        case 1:
+        {
+            return self.customImageArray.count;
+        }
+            break;
+            
+        default:
+            return 0;
+    }
+}
+
+- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
+    CCustomizeStampTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"cell"];
+    if (cell == nil) {
+        cell = [[CCustomizeStampTableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:@"cell"];
+    }
+    if (self.customTextArray.count>0 || self.customImageArray.count>0) {
+        if (0 == indexPath.section) {
+            cell.customizeStampImageView.image = self.customTextArray[indexPath.row];
+        } else {
+            NSDictionary *tDic = self.customImageArray[indexPath.item];
+            UIImage *img = [self.imgDicCache objectForKey:tDic];
+            if (!img) {
+                NSString *tPath   = [tDic objectForKey:@"path"];
+                NSString *tFileName = [[NSFileManager defaultManager] displayNameAtPath:tPath];
+                NSString *tRealPath = [NSString stringWithFormat:@"%@/%@",kPDFStampDataFolder,tFileName];
+                UIImage  *tImg    = [UIImage imageWithContentsOfFile:tRealPath];
+                img = [self compressImage:tImg];
+                [self.imgDicCache setObject:img forKey:tDic];
+            }
+            cell.customizeStampImageView.image = img;
+        }
+    }
+    
+    return cell;
+}
+
 @end

+ 48 - 0
compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFStamp/CStampPreview.h

@@ -0,0 +1,48 @@
+//
+//  CStampPreview.h
+//  compdfkit-tools
+//
+//  Copyright © 2014-2023 PDF Technologies, Inc. All Rights Reserved.
+//
+//  THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
+//  AND MAY NOT BE RESOLD OR REDISTRIBUTED. USAGE IS BOUND TO THE ComPDFKit LICENSE AGREEMENT.
+//  UNAUTHORIZED REPRODUCTION OR DISTRIBUTION IS SUBJECT TO CIVIL AND CRIMINAL PENALTIES.
+//  This notice may not be removed from this file.
+//
+
+#import <UIKit/UIKit.h>
+
+NS_ASSUME_NONNULL_BEGIN
+
+typedef NS_ENUM(NSInteger, TextStampType) {
+    TextStampTypeCenter = 0,
+    TextStampTypeLeft,
+    TextStampTypeRight,
+    TextStampTypeNone
+};
+
+@interface CStampPreview : UIView
+
+@property (nonatomic, assign) NSInteger textStampStyle;
+
+@property (nonatomic, assign) BOOL textStampHaveDate;
+
+@property (nonatomic, assign) BOOL textStampHaveTime;
+
+@property (nonatomic, strong) NSString *textStampText;
+
+@property (nonatomic, strong) NSString *dateTime;
+
+@property (nonatomic, assign) CGRect stampBounds;
+
+@property (nonatomic, assign) float scale;
+
+@property (nonatomic, assign) CGFloat leftMargin;
+
+@property (nonatomic, strong) UIColor *color;
+
+- (UIImage *)renderImage;
+
+@end
+
+NS_ASSUME_NONNULL_END

+ 445 - 0
compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFStamp/CStampPreview.m

@@ -0,0 +1,445 @@
+//
+//  CStampPreview.m
+//  compdfkit-tools
+//
+//  Copyright © 2014-2023 PDF Technologies, Inc. All Rights Reserved.
+//
+//  THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
+//  AND MAY NOT BE RESOLD OR REDISTRIBUTED. USAGE IS BOUND TO THE ComPDFKit LICENSE AGREEMENT.
+//  UNAUTHORIZED REPRODUCTION OR DISTRIBUTION IS SUBJECT TO CIVIL AND CRIMINAL PENALTIES.
+//  This notice may not be removed from this file.
+//
+
+#import "CStampPreview.h"
+
+static float c01, c02, c03, c11, c12, c13;
+
+#define kStampPreview_OnlyText_Size     48.0
+#define kStampPreview_Text_Size         30.0
+#define kStampPreview_Date_Size         20.0
+
+@implementation CStampPreview
+
+@synthesize textStampText = _textStampText;
+@synthesize textStampStyle = _textStampStyle;
+@synthesize textStampHaveDate = _textStampHaveDate;
+@synthesize textStampHaveTime = _textStampHaveTime;
+@synthesize leftMargin = _leftMargin;
+
+- (instancetype)initWithFrame:(CGRect)frame {
+    self = [super initWithFrame:frame];
+    if (self)
+    {
+        self.backgroundColor = [UIColor clearColor];
+        _scale = ([[UIScreen mainScreen] scale] == 2.0) ? 2.0f : 1.0f;
+    }
+    return self;
+}
+
+- (NSString *)getDateTime {
+    NSTimeZone* timename = [NSTimeZone systemTimeZone];
+    NSDateFormatter *outputFormatter = [[NSDateFormatter alloc] init ];
+    [outputFormatter setTimeZone:timename ];
+    
+    NSString *tDate = nil;
+    if (_textStampHaveDate && !_textStampHaveTime)
+    {
+        tDate = [NSDateFormatter localizedStringFromDate:[NSDate date]
+                                               dateStyle:NSDateFormatterShortStyle
+                                               timeStyle:NSDateFormatterNoStyle];
+    }
+    else if (_textStampHaveTime && !_textStampHaveDate)
+    {
+        [outputFormatter setDateFormat:@"HH:mm:ss"];
+        tDate = [outputFormatter stringFromDate:[NSDate date]];
+    }
+    else if (_textStampHaveDate && _textStampHaveTime)
+    {
+        [outputFormatter setDateFormat:@" HH:mm"];
+        tDate = [NSDateFormatter localizedStringFromDate:[NSDate date]
+                                               dateStyle:NSDateFormatterShortStyle
+                                               timeStyle:NSDateFormatterNoStyle];
+        tDate = [tDate stringByAppendingString:[outputFormatter stringFromDate:[NSDate date]]];
+    }
+    
+    return tDate;
+}
+
+// Draw the fill effect
+static void MyShaderProcedure(void *info, const CGFloat *in, CGFloat *out) {
+    CGFloat v;
+    size_t k, components;
+    
+    components = (size_t)info;
+    
+    v = *in;
+    for (k = 0; k < components -1; k++)
+    {
+        if (0 == k) {
+            *out++ = c01 + v * (c11-c01);
+        }
+        else if (1 == k)
+        {
+            *out++ = c02 + v * (c12-c02);
+        }
+        else if (2 == k) {
+            *out++ = c03 + v * (c13-c03);
+        }
+    }
+    *out++ = 0.85;
+}
+
+// Calculate Rect based on text
+- (void)fitStampRect {
+    UIFont *tTextFont = nil;
+    UIFont *tTimeFont = nil;
+    NSString *drawText = nil;
+    NSString *dateText = nil;
+    
+    if (self.textStampText.length < 1 && !self.dateTime) {
+        drawText = @"StampText";
+        tTextFont = [UIFont fontWithName:@"Helvetica" size:kStampPreview_OnlyText_Size];
+    } else if (self.textStampText.length > 0 && self.dateTime.length > 0) {
+        tTextFont = [UIFont fontWithName:@"Helvetica" size:kStampPreview_Text_Size];
+        tTimeFont = [UIFont fontWithName:@"Helvetica" size:kStampPreview_Date_Size];
+        drawText = self.textStampText;
+        dateText = self.dateTime;
+    } else {
+        if (self.dateTime) {
+            drawText = self.dateTime;
+        } else {
+            drawText = self.textStampText;
+        }
+        tTextFont = [UIFont fontWithName:@"Helvetica" size:kStampPreview_OnlyText_Size];
+    }
+    
+    CGSize tTextSize = [drawText sizeWithAttributes:@{ NSFontAttributeName : tTextFont }];
+    CGSize tTimeSize = CGSizeZero;
+    if (tTimeFont) {
+        tTimeSize = [dateText sizeWithAttributes:@{ NSFontAttributeName : tTimeFont }];
+    }
+    
+    int w = tTextSize.width > tTimeSize.width ? tTextSize.width : tTimeSize.width;
+    int count = 0;
+    for (int i = 0; i < drawText.length; ++i) {
+        NSRange range = NSMakeRange(i,1);
+        NSString *aStr = [drawText substringWithRange:range];
+        if ([aStr isEqualToString:@" "]) {
+            ++count;
+        }
+    }
+    if (tTextSize.width < tTimeSize.width) {
+        w += 15;
+    } else {
+        w += 13 + 5 * count;
+    }
+    
+    int h = tTextSize.height + 5;
+    if (dateText) {
+        h = tTextSize.height + tTimeSize.height + 8.011;
+    }
+    
+    if (_textStampStyle == TextStampTypeLeft) {
+        
+        w = w + h * 0.618033;
+        
+    } else if (_textStampStyle == TextStampTypeRight) {
+        
+        w = w + h * 0.618033;
+    }
+    float x = 0.0;
+    float y = 0.0;
+    
+    _scale = 1.0;
+    CGFloat maxW = 300 - _leftMargin;
+    if (w > maxW ) {
+        _scale = maxW/w;
+        h = h*_scale;
+        x = self.frame.size.width/2.0  - maxW/2.0;
+        y = self.frame.size.height/2.0 - h/2.0;
+        _stampBounds = CGRectMake(x + _leftMargin, y, maxW, h);
+    } else {
+        x = self.frame.size.width/2.0  - w/2.0;
+        y = self.frame.size.height/2.0 - h/2.0;
+        _stampBounds = CGRectMake(x + _leftMargin, y, w, h);
+    }
+}
+
+// Only override drawRect: if you perform custom drawing.
+// An empty implementation adversely affects performance during animation.
+- (void)drawRect:(CGRect)rect {
+    self.dateTime = [self getDateTime];
+    [self fitStampRect];
+
+    CGContextRef context = UIGraphicsGetCurrentContext();
+    CGContextSetFillColorWithColor(context, [UIColor purpleColor].CGColor);
+    // Draw border background
+    if (TextStampTypeNone != _textStampStyle) {
+        [self drawBounder:context];
+    }
+    
+    // Draws custom text
+    [self drawText:context];
+}
+
+- (void)drawBounder:(CGContextRef)context {
+    if (!context) {
+        return;
+    }
+    
+    CGContextSaveGState(context);
+    
+    const CGFunctionCallbacks callbacks = {
+        .version = 0, .evaluate = &MyShaderProcedure, .releaseInfo = NULL
+    };
+    
+    c01 = 0.81;
+    c02 = 0.88;
+    c03 = 0.78;
+    
+    c11 = 0.95;
+    c12 = 0.95;
+    c13 = 0.95;
+
+    size_t components = 1 + CGColorSpaceGetNumberOfComponents(CGColorSpaceCreateDeviceRGB());
+    CGFunctionRef funcRef = CGFunctionCreate((void *) components,
+                                             1,
+                                             (CGFloat[]){0.0f, 1.0f},
+                                             4,
+                                             //(CGFloat[]){0.0f, 1.0f, 0.0f, 1.0f, 0.0f, 1.0f, 0.0f, 1.0f},
+                                             (CGFloat[]){c01, c11, c02, c12, c03, c13, 0.0f, 1.0f},
+                                             &callbacks);
+    
+    CGColorSpaceRef colorSpaceRef = CGColorSpaceCreateDeviceRGB();
+    
+    CGShadingRef shadingRef = CGShadingCreateAxial(colorSpaceRef,
+                                                   CGPointMake(_stampBounds.origin.x+_stampBounds.size.width*0.75, _stampBounds.origin.y+_stampBounds.size.width*0.25),
+                                                   CGPointMake(_stampBounds.origin.x+_stampBounds.size.width*0.25, _stampBounds.origin.y+_stampBounds.size.width*0.75),
+                                                   funcRef, true, true);
+    
+    CGColorSpaceRelease(colorSpaceRef);
+    
+    CGFunctionRelease(funcRef);
+    
+    if (_textStampStyle == TextStampTypeCenter) {
+        [self drawNormalRect:context];
+    } else if (_textStampStyle == TextStampTypeLeft) {
+        [self drawLeftBounder:context];
+    } else if (_textStampStyle == TextStampTypeRight) {
+        [self drawRightBounder:context];
+    }
+    CGContextClip (context);
+    
+    CGContextSaveGState(context);
+    CGContextDrawShading(context, shadingRef);
+    CGContextRestoreGState(context);
+    
+    CGShadingRelease(shadingRef);
+    
+    if (_textStampStyle == TextStampTypeCenter) {
+        [self drawNormalRect:context];
+    } else if (_textStampStyle == TextStampTypeLeft) {
+        [self drawLeftBounder:context];
+    } else if (_textStampStyle == TextStampTypeRight) {
+        [self drawRightBounder:context];
+    }
+    CGContextStrokePath(context);
+}
+
+- (void)drawNormalRect:(CGContextRef)context {
+    float tmpHeight = 11.0 * _stampBounds.size.height/50;
+    float tmpWidth = 3.0 * _stampBounds.size.height/50;
+    float hw1 = 5.54492 * _stampBounds.size.height/50;
+    float hw2 = 4.40039 * _stampBounds.size.height/50;
+    
+    CGContextBeginPath (context);
+    
+    CGContextMoveToPoint(context, _stampBounds.origin.x+tmpWidth, _stampBounds.origin.y+_stampBounds.size.height-tmpHeight);
+    
+    CGContextAddCurveToPoint(context, _stampBounds.origin.x+tmpWidth, _stampBounds.origin.y+_stampBounds.size.height-tmpHeight+hw2, _stampBounds.origin.x+tmpHeight-hw1, _stampBounds.origin.y+_stampBounds.size.height-tmpWidth, _stampBounds.origin.x+tmpHeight, _stampBounds.origin.y+_stampBounds.size.height-tmpWidth);
+    
+    CGContextAddLineToPoint(context, _stampBounds.origin.x+_stampBounds.size.width-tmpHeight, _stampBounds.origin.y+_stampBounds.size.height-tmpWidth);
+    
+    CGContextAddCurveToPoint(context, _stampBounds.origin.x+_stampBounds.size.width-tmpHeight+hw1, _stampBounds.origin.y+_stampBounds.size.height-tmpWidth, _stampBounds.origin.x+_stampBounds.size.width-tmpWidth, _stampBounds.origin.y+_stampBounds.size.height-tmpHeight+hw2, _stampBounds.origin.x+_stampBounds.size.width-tmpWidth, _stampBounds.origin.y+_stampBounds.size.height-tmpHeight);
+    
+    CGContextAddLineToPoint(context, _stampBounds.origin.x+_stampBounds.size.width-tmpWidth, _stampBounds.origin.y+tmpHeight);
+    
+    CGContextAddCurveToPoint(context, _stampBounds.origin.x+_stampBounds.size.width-tmpWidth, _stampBounds.origin.y+tmpHeight-hw2, _stampBounds.origin.x+_stampBounds.size.width-tmpHeight+hw1, _stampBounds.origin.y+tmpWidth, _stampBounds.origin.x+_stampBounds.size.width-tmpHeight, _stampBounds.origin.y+tmpWidth);
+    
+    CGContextAddLineToPoint(context,_stampBounds.origin.x+tmpHeight, _stampBounds.origin.y+tmpWidth);
+    
+    CGContextAddCurveToPoint(context, _stampBounds.origin.x+tmpHeight-hw1, _stampBounds.origin.y+tmpWidth, _stampBounds.origin.x+tmpWidth, _stampBounds.origin.y+tmpHeight-hw2, _stampBounds.origin.x+tmpWidth, _stampBounds.origin.y+tmpHeight);
+    
+    CGContextAddLineToPoint(context,_stampBounds.origin.x+tmpWidth, _stampBounds.origin.y+_stampBounds.size.height-tmpHeight);
+    
+    CGContextClosePath (context);
+}
+
+- (void)drawLeftBounder:(CGContextRef)context {
+    float tmpHeight = 11.0 * _stampBounds.size.height/50;
+    float tmpWidth = 3.0 * _stampBounds.size.height/50;
+    float hw1 = 5.54492 * _stampBounds.size.height/50;
+    float hw2 = 4.40039 * _stampBounds.size.height/50;
+    
+    float x0 = _stampBounds.origin.x + _stampBounds.size.height * 0.618033;
+    float y0 = _stampBounds.origin.y;
+    
+    float x1 = _stampBounds.origin.x + _stampBounds.size.width;
+    float y1 = _stampBounds.origin.y + _stampBounds.size.height;
+    
+    float xp = _stampBounds.origin.x;
+    float yp = _stampBounds.origin.y + _stampBounds.size.height / 2.0;
+    
+    CGContextBeginPath (context);
+    
+    CGContextMoveToPoint(context, x0 + tmpHeight, y1 - tmpWidth);
+    CGContextAddLineToPoint(context, x1-tmpHeight, y1-tmpWidth);
+    CGContextAddCurveToPoint(context, x1-tmpHeight+hw1, y1-tmpWidth, x1-tmpWidth, y1-tmpHeight+hw2, x1-tmpWidth, y1-tmpHeight);
+    CGContextAddLineToPoint(context, x1-tmpWidth, y0+tmpHeight);
+    CGContextAddCurveToPoint(context, x1-tmpWidth, y0+tmpHeight-hw2, x1-tmpHeight+hw1, y0+tmpWidth, x1-tmpHeight, y0+tmpWidth);
+    
+    CGContextAddLineToPoint(context, x0+tmpHeight, y0+tmpWidth);
+    CGContextAddLineToPoint(context, xp+tmpHeight, yp);
+    CGContextAddLineToPoint(context, x0+tmpHeight, y1-tmpWidth);
+    
+    CGContextClosePath (context);
+}
+
+- (void)drawRightBounder:(CGContextRef)context {
+    float tmpHeight = 11.0 * _stampBounds.size.height/50;
+    float tmpWidth = 3.0 * _stampBounds.size.height/50;
+    float hw1 = 5.54492 * _stampBounds.size.height/50;
+    float hw2 = 4.40039 * _stampBounds.size.height/50;
+    
+    float x0 = _stampBounds.origin.x;
+    float y0 = _stampBounds.origin.y;
+    
+    float x1 = _stampBounds.origin.x + _stampBounds.size.width - _stampBounds.size.height * 0.618033;
+    float y1 = _stampBounds.origin.y + _stampBounds.size.height;
+    
+    float xp = _stampBounds.origin.x + _stampBounds.size.width;
+    float yp = _stampBounds.origin.y + _stampBounds.size.height / 2.0;
+    
+    CGContextBeginPath (context);
+    
+    CGContextMoveToPoint(context, x0 + tmpWidth, y1 - tmpHeight);
+    CGContextAddCurveToPoint(context, x0+tmpWidth, y1-tmpHeight+hw2, x0+tmpHeight-hw1, y1-tmpWidth, x0+tmpHeight, y1-tmpWidth);
+    CGContextAddLineToPoint(context, x1-tmpHeight, y1-tmpWidth);
+    CGContextAddLineToPoint(context, xp-tmpHeight, yp);
+    CGContextAddLineToPoint(context, x1-tmpHeight, y0+tmpWidth);
+    CGContextAddLineToPoint(context, x0+tmpHeight, y0+tmpWidth);
+    CGContextAddCurveToPoint(context, x0+tmpHeight-hw1, y0+tmpWidth, x0+tmpWidth, y0+tmpHeight-hw2, x0+tmpWidth, y0+tmpHeight);
+    CGContextAddLineToPoint(context, x0+tmpWidth, y1-tmpHeight);
+    
+    CGContextClosePath (context);
+}
+
+- (void)drawText:(CGContextRef)context {
+    if (!context) {
+        return;
+    }
+    
+    CGContextSetTextMatrix(context, CGAffineTransformMakeScale(1.0, -1.0));
+    
+    NSString *drawText = nil;
+    NSString *dateText = nil;
+    
+    if (self.textStampText.length < 1 && !self.dateTime) {
+        drawText = @"StampText";
+    } else if (self.textStampText.length > 0 && self.dateTime.length > 0) {
+        drawText = self.textStampText;
+        dateText = self.dateTime;
+    } else {
+        if (self.dateTime) {
+            drawText = self.dateTime;
+        } else {
+            drawText = self.textStampText;
+        }
+    }
+    
+    if (!dateText) {
+        float fontsize = kStampPreview_OnlyText_Size*_scale;
+        UIFont* font = [UIFont fontWithName:@"Helvetica" size:fontsize];
+        CGRect rt = CGRectInset(_stampBounds, 0, 0);
+        rt.origin.x += 8.093 * _scale;
+        
+        if (_textStampStyle == TextStampTypeLeft) {
+            rt.origin.x += rt.size.height * 0.618033;
+        }
+        
+        UIGraphicsPushContext(context);
+        
+        [self.color set];
+        [drawText drawInRect:rt withFont:font lineBreakMode:NSLineBreakByWordWrapping alignment:NSTextAlignmentLeft];
+        UIGraphicsPopContext();
+        
+    } else {
+        float tFontSize = kStampPreview_Text_Size*_scale;
+        UIFont *tFont = [UIFont fontWithName:@"Helvetica" size:tFontSize];
+        
+        CGRect tTextRT = CGRectInset(_stampBounds, 0, 0);
+        tTextRT.origin.x += 8.093 * _scale;
+        
+        if (_textStampStyle == TextStampTypeLeft) {
+            tTextRT.origin.x += tTextRT.size.height * 0.618033;
+        }
+        
+        UIGraphicsPushContext(context);
+        [self.color set];
+        if (drawText.length > 0) {
+            [drawText drawInRect:tTextRT withFont:tFont lineBreakMode:NSLineBreakByWordWrapping alignment:NSTextAlignmentLeft];
+            
+            CGRect tDateRT = CGRectInset(_stampBounds, 0, 0);
+            tDateRT.origin.x += 8.093 * _scale;
+            if (_textStampStyle == TextStampTypeLeft) {
+                tDateRT.origin.x += tDateRT.size.height * 0.618033;
+            }
+            tDateRT.origin.y = tDateRT.origin.y + tFontSize + 6.103*_scale;
+            
+            tFontSize = kStampPreview_Date_Size;
+            tFont = [UIFont fontWithName:@"Helvetica" size:tFontSize];
+            
+            [[UIColor purpleColor] set];
+            [dateText drawInRect:tDateRT withFont:tFont lineBreakMode:NSLineBreakByWordWrapping alignment:NSTextAlignmentLeft];
+        } else {
+            float fontsize = kStampPreview_Date_Size*_scale;
+            UIFont* font = [UIFont fontWithName:@"Helvetica" size:fontsize];
+            
+            CGRect rt = CGRectInset(_stampBounds, 0, 0);
+            rt.origin.x += 8.093 * _scale;
+            
+            if (_textStampStyle == TextStampTypeLeft) {
+                rt.origin.x += rt.size.height * 0.618033;
+            }
+            
+            [self.color set];
+            [dateText drawInRect:rt withFont:font lineBreakMode:NSLineBreakByWordWrapping alignment:NSTextAlignmentLeft];
+        }
+        
+        UIGraphicsPopContext();
+    }
+}
+
+- (UIImage *)renderImage
+{
+    UIImage *image = [self renderImageFromView:self];
+    return image;
+}
+
+/* Convert UIView to UIImage */
+- (UIImage *)renderImageFromView:(UIView *)view
+{
+    UIGraphicsBeginImageContextWithOptions(view.bounds.size, NO, 1.0);
+    
+    CGContextRef context=UIGraphicsGetCurrentContext();
+    CGContextTranslateCTM(context, 1.0, 1.0);
+    
+    [view.layer renderInContext:context];
+    
+    UIImage *image = UIGraphicsGetImageFromCurrentImageContext();
+    UIGraphicsEndImageContext();
+    
+    return image;
+}
+
+@end

+ 33 - 0
compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFStamp/CStampShapView.h

@@ -0,0 +1,33 @@
+//
+//  CStampShapView.h
+//  compdfkit-tools
+//
+//  Copyright © 2014-2023 PDF Technologies, Inc. All Rights Reserved.
+//
+//  THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
+//  AND MAY NOT BE RESOLD OR REDISTRIBUTED. USAGE IS BOUND TO THE ComPDFKit LICENSE AGREEMENT.
+//  UNAUTHORIZED REPRODUCTION OR DISTRIBUTION IS SUBJECT TO CIVIL AND CRIMINAL PENALTIES.
+//  This notice may not be removed from this file.
+//
+
+#import <UIKit/UIKit.h>
+
+NS_ASSUME_NONNULL_BEGIN
+
+@class CStampShapView;
+
+@protocol CStampShapViewDelegate <NSObject>
+
+@optional
+
+- (void)stampShapView:(CStampShapView *)stampShapView tag:(NSInteger)tag;
+
+@end
+
+@interface CStampShapView : UIView
+
+@property (nonatomic, weak) id<CStampShapViewDelegate> delegate;
+
+@end
+
+NS_ASSUME_NONNULL_END

+ 92 - 0
compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFStamp/CStampShapView.m

@@ -0,0 +1,92 @@
+//
+//  CStampShapView.m
+//  compdfkit-tools
+//
+//  Copyright © 2014-2023 PDF Technologies, Inc. All Rights Reserved.
+//
+//  THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
+//  AND MAY NOT BE RESOLD OR REDISTRIBUTED. USAGE IS BOUND TO THE ComPDFKit LICENSE AGREEMENT.
+//  UNAUTHORIZED REPRODUCTION OR DISTRIBUTION IS SUBJECT TO CIVIL AND CRIMINAL PENALTIES.
+//  This notice may not be removed from this file.
+//
+
+#import "CStampShapView.h"
+
+@interface CStampShapView ()
+
+@property (nonatomic, strong) UILabel *titleLabel;
+
+@property (nonatomic, strong) UIButton *centerButton;
+
+@property (nonatomic, strong) UIButton *leftButton;
+
+@property (nonatomic, strong) UIButton *rightButton;
+
+@property (nonatomic, strong) UIButton *noneButton;
+
+@property (nonatomic, strong) UIView *shapeView;
+
+@end
+
+@implementation CStampShapView
+
+#pragma mark - Initializers
+
+- (instancetype)initWithFrame:(CGRect)frame {
+    if (self = [super initWithFrame:frame]) {
+        self.titleLabel = [[UILabel alloc] init];
+        self.titleLabel.text = NSLocalizedString(@"Shape", nil);
+        self.titleLabel.autoresizingMask = UIViewAutoresizingFlexibleRightMargin;
+        self.titleLabel.textColor = [UIColor grayColor];
+        self.titleLabel.font = [UIFont systemFontOfSize:12.0];
+        [self addSubview:self.titleLabel];
+        
+        self.shapeView = [[UIView alloc] initWithFrame:CGRectMake(0, 30, self.bounds.size.width, 60)];
+        [self addSubview:self.shapeView];
+    
+        self.centerButton = [[UIButton alloc] init];
+        [self.centerButton setImage:[UIImage imageNamed:@"CPDFStampTextImageCenter" inBundle:[NSBundle bundleForClass:self.class] compatibleWithTraitCollection:nil] forState:UIControlStateNormal];
+        [self.centerButton addTarget:self action:@selector(buttonItemClicked_select:) forControlEvents:UIControlEventTouchUpInside];
+        self.centerButton.tag = 0;
+        [self.shapeView addSubview:self.centerButton];
+        
+        self.leftButton = [[UIButton alloc] init];
+        [self.leftButton setImage:[UIImage imageNamed:@"CPDFStampTextImageLeft" inBundle:[NSBundle bundleForClass:self.class] compatibleWithTraitCollection:nil] forState:UIControlStateNormal];
+        [self.leftButton addTarget:self action:@selector(buttonItemClicked_select:) forControlEvents:UIControlEventTouchUpInside];
+        self.leftButton.tag = 1;
+        [self.shapeView addSubview:self.leftButton];
+        
+        self.rightButton = [[UIButton alloc] init];
+        [self.rightButton setImage:[UIImage imageNamed:@"CPDFStampTextImageRight" inBundle:[NSBundle bundleForClass:self.class] compatibleWithTraitCollection:nil] forState:UIControlStateNormal];
+        [self.rightButton addTarget:self action:@selector(buttonItemClicked_select:) forControlEvents:UIControlEventTouchUpInside];
+        self.rightButton.tag = 2;
+        [self.shapeView addSubview:self.rightButton];
+        
+        self.noneButton = [[UIButton alloc] init];
+        [self.noneButton setImage:[UIImage imageNamed:@"CPDFStampTextImageNone" inBundle:[NSBundle bundleForClass:self.class] compatibleWithTraitCollection:nil] forState:UIControlStateNormal];
+        [self.noneButton addTarget:self action:@selector(buttonItemClicked_select:) forControlEvents:UIControlEventTouchUpInside];
+        self.noneButton.tag = 3;
+        [self.shapeView addSubview:self.noneButton];
+    }
+    return self;
+}
+
+- (void)layoutSubviews {
+    [super layoutSubviews];
+    self.titleLabel.frame = CGRectMake(20, 0, 50, self.bounds.size.height/3);
+    self.shapeView.frame = CGRectMake(0, self.bounds.size.height/3, self.bounds.size.width, (self.bounds.size.height/3)*2);
+    self.centerButton.frame = CGRectMake((self.shapeView.bounds.size.width - (self.shapeView.bounds.size.height*4))/5, 0, self.shapeView.bounds.size.height, self.shapeView.bounds.size.height);
+    self.leftButton.frame = CGRectMake(((self.shapeView.bounds.size.width - (self.shapeView.bounds.size.height*4))/5)*2 + self.shapeView.bounds.size.height, 0, self.shapeView.bounds.size.height, self.shapeView.bounds.size.height);
+    self.rightButton.frame = CGRectMake(((self.shapeView.bounds.size.width - (self.shapeView.bounds.size.height*4))/5)*3 + self.shapeView.bounds.size.height*2, 0, self.shapeView.bounds.size.height, self.shapeView.bounds.size.height);
+    self.noneButton.frame = CGRectMake(((self.shapeView.bounds.size.width - (self.shapeView.bounds.size.height*4))/5)*4 + self.shapeView.bounds.size.height*3, 0, self.shapeView.bounds.size.height, self.shapeView.bounds.size.height);
+}
+
+#pragma mark - Action
+
+- (void)buttonItemClicked_select:(UIButton *)button {
+    if (self.delegate && [self.delegate respondsToSelector:@selector(stampShapView:tag:)]) {
+        [self.delegate stampShapView:self tag:button.tag];
+    }
+}
+
+@end

+ 21 - 0
compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFStamp/CStampTextViewController.h

@@ -0,0 +1,21 @@
+//
+//  CStampTextViewController.h
+//  compdfkit-tools
+//
+//  Copyright © 2014-2023 PDF Technologies, Inc. All Rights Reserved.
+//
+//  THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
+//  AND MAY NOT BE RESOLD OR REDISTRIBUTED. USAGE IS BOUND TO THE ComPDFKit LICENSE AGREEMENT.
+//  UNAUTHORIZED REPRODUCTION OR DISTRIBUTION IS SUBJECT TO CIVIL AND CRIMINAL PENALTIES.
+//  This notice may not be removed from this file.
+//
+
+#import <UIKit/UIKit.h>
+
+NS_ASSUME_NONNULL_BEGIN
+
+@interface CStampTextViewController : UIViewController
+
+@end
+
+NS_ASSUME_NONNULL_END

+ 267 - 0
compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFStamp/CStampTextViewController.m

@@ -0,0 +1,267 @@
+//
+//  CStampTextViewController.m
+//  compdfkit-tools
+//
+//  Copyright © 2014-2023 PDF Technologies, Inc. All Rights Reserved.
+//
+//  THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
+//  AND MAY NOT BE RESOLD OR REDISTRIBUTED. USAGE IS BOUND TO THE ComPDFKit LICENSE AGREEMENT.
+//  UNAUTHORIZED REPRODUCTION OR DISTRIBUTION IS SUBJECT TO CIVIL AND CRIMINAL PENALTIES.
+//  This notice may not be removed from this file.
+//
+
+#import "CStampTextViewController.h"
+#import "CStampPreview.h"
+#import "CStampShapView.h"
+#import "CPDFColorSelectView.h"
+#import "CPDFColorPickerView.h"
+
+@interface CStampTextViewController () <CPDFColorSelectViewDelegate, CStampShapViewDelegate, CPDFColorPickerViewDelegate>
+
+@property (nonatomic, strong) CStampPreview *preView;
+
+@property (nonatomic, strong) UITextField *stampTextField;
+
+@property (nonatomic, strong) UISwitch *haveDateSwitch;
+
+@property (nonatomic, strong) UISwitch *haveTimeSwitch;
+
+@property (nonatomic, strong) UIButton *doneBtn;
+
+@property (nonatomic, strong) UILabel *titleLabel;
+
+@property (nonatomic, strong) UIButton *cancelBtn;
+
+@property (nonatomic, strong) UILabel *dateLabel;
+
+@property (nonatomic, strong) UILabel *timeLabel;
+
+@property (nonatomic, strong) CPDFColorSelectView *colorView;
+
+@property (nonatomic, strong) CStampShapView *stampShapeViw;
+
+@property (nonatomic, strong) CPDFColorPickerView *colorPicker;
+
+@property (nonatomic, assign) NSInteger textStampStyle;
+
+@end
+
+@implementation CStampTextViewController
+
+- (void)viewDidLoad {
+    [super viewDidLoad];
+    // Do any additional setup after loading the view.
+    self.titleLabel = [[UILabel alloc] init];
+    self.titleLabel.autoresizingMask = UIViewAutoresizingFlexibleRightMargin;
+    self.titleLabel.text = NSLocalizedString(@"Create Stamp", nil);
+    self.titleLabel.font = [UIFont systemFontOfSize:20];
+    self.titleLabel.adjustsFontSizeToFitWidth = YES;
+    [self.view addSubview:self.titleLabel];
+    
+    self.doneBtn = [[UIButton alloc] init];
+    self.doneBtn.autoresizingMask = UIViewAutoresizingFlexibleRightMargin;
+    [self.doneBtn setTitle:NSLocalizedString(@"Done", nil) forState:UIControlStateNormal];
+    [self.doneBtn setTitleColor:[UIColor blueColor] forState:UIControlStateNormal];
+    [self.doneBtn addTarget:self action:@selector(buttonItemClicked_done:) forControlEvents:UIControlEventTouchUpInside];
+    [self.view addSubview:self.doneBtn];
+    
+    self.cancelBtn = [[UIButton alloc] init];
+    self.cancelBtn.autoresizingMask = UIViewAutoresizingFlexibleLeftMargin;
+    self.cancelBtn.titleLabel.adjustsFontSizeToFitWidth = YES;
+    [self.cancelBtn setTitle:NSLocalizedString(@"Cancel", nil) forState:UIControlStateNormal];
+    [self.cancelBtn setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
+    [self.cancelBtn addTarget:self action:@selector(buttonItemClicked_cancel:) forControlEvents:UIControlEventTouchUpInside];
+    [self.view addSubview:self.cancelBtn];
+    
+    self.preView = [[CStampPreview alloc] init];
+    self.preView.backgroundColor = [UIColor whiteColor];
+    self.preView.color = [UIColor greenColor];
+    self.preView.layer.borderColor = [UIColor colorWithRed:0 green:0 blue:0 alpha:0.1].CGColor;
+    self.preView.layer.borderWidth = 1.0;
+    self.preView.autoresizingMask = UIViewAutoresizingFlexibleRightMargin;
+    [self.view addSubview:self.preView];
+    
+    self.stampTextField = [[UITextField alloc] init];
+    self.stampTextField.contentVerticalAlignment = UIControlContentVerticalAlignmentCenter;
+    self.stampTextField.returnKeyType = UIReturnKeyDone;
+    self.stampTextField.clearButtonMode = YES;
+    self.stampTextField.borderStyle = UITextBorderStyleLine;
+    [self.stampTextField addTarget:self action:@selector(textFieldEditChange:) forControlEvents:UIControlEventEditingChanged];
+    self.stampTextField.placeholder = NSLocalizedString(@"Example Text", nil);
+    [self.view addSubview:self.stampTextField];
+    
+    self.colorView = [[CPDFColorSelectView alloc] init];
+    self.colorView.delegate = self;
+    self.colorView.autoresizingMask = UIViewAutoresizingFlexibleWidth;
+    [self.view addSubview:self.colorView];
+    
+    self.stampShapeViw = [[CStampShapView alloc] init];
+    self.stampShapeViw.delegate = self;
+    self.stampShapeViw.autoresizingMask = UIViewAutoresizingFlexibleWidth;
+    [self.view addSubview:self.stampShapeViw];
+    
+    self.dateLabel = [[UILabel alloc] init];
+    self.dateLabel.text = NSLocalizedString(@"Date", nil);
+    self.dateLabel.font = [UIFont systemFontOfSize:12.0];
+    [self.view addSubview:self.dateLabel];
+    
+    self.haveDateSwitch = [[UISwitch alloc] init];
+    [self.haveDateSwitch setOn:NO animated:NO];
+    self.haveDateSwitch.autoresizingMask = UIViewAutoresizingFlexibleLeftMargin;
+    [self.haveDateSwitch addTarget:self action:@selector(switchChange_date:) forControlEvents:UIControlEventValueChanged];
+    [self.view addSubview:self.haveDateSwitch];
+    
+    self.timeLabel = [[UILabel alloc] init];
+    self.timeLabel.text = NSLocalizedString(@"Time", nil);
+    self.timeLabel.font = [UIFont systemFontOfSize:12.0];
+    self.timeLabel.autoresizingMask = UIViewAutoresizingFlexibleRightMargin;
+    [self.view addSubview:self.timeLabel];
+    
+    self.haveTimeSwitch = [[UISwitch alloc] init];
+    [self.haveTimeSwitch setOn:NO animated:NO];
+    self.haveTimeSwitch.autoresizingMask = UIViewAutoresizingFlexibleLeftMargin;
+    [self.haveDateSwitch addTarget:self action:@selector(switchChange_time:) forControlEvents:UIControlEventValueChanged];
+    [self.view addSubview:self.haveTimeSwitch];
+    
+    self.view.backgroundColor = [UIColor whiteColor];
+    [self updatePreferredContentSizeWithTraitCollection:self.traitCollection];
+}
+
+- (void)viewWillLayoutSubviews {
+    [super viewWillLayoutSubviews];
+    self.titleLabel.frame = CGRectMake((self.view.frame.size.width - 120)/2, 5, 120, 50);
+    self.preView.frame  = CGRectMake((self.view.frame.size.width - 350)/2, 60, 350, 120);
+    self.stampTextField.frame = CGRectMake((self.view.frame.size.width - 350)/2, 190, 350, 30);
+    
+    if (@available(iOS 11.0, *)) {
+        self.doneBtn.frame = CGRectMake(self.view.frame.size.width - 60 - self.view.safeAreaInsets.right, 5, 50, 50);
+        self.cancelBtn.frame = CGRectMake(self.view.safeAreaInsets.left + 10, 5, 50, 50);
+        self.stampShapeViw.frame = CGRectMake(self.view.safeAreaInsets.left, 240,self.view.frame.size.width - self.view.safeAreaInsets.left - self.view.safeAreaInsets.right, 90);
+        self.colorView.frame = CGRectMake(self.view.safeAreaInsets.left, 340,self.view.frame.size.width - self.view.safeAreaInsets.left - self.view.safeAreaInsets.right, 90);
+        self.dateLabel.frame = CGRectMake(self.view.safeAreaInsets.left+15, 430, 80, 50);
+        self.haveDateSwitch.frame = CGRectMake(self.view.frame.size.width - 75- self.view.safeAreaInsets.right, 430, 60, 50);
+        self.timeLabel.frame = CGRectMake(self.view.safeAreaInsets.left+15, 480, 100, 45);
+        self.haveTimeSwitch.frame = CGRectMake(self.view.frame.size.width - 75- self.view.safeAreaInsets.right, 480, 60, 50);
+    } else {
+        self.colorView.frame = CGRectMake(0, 340, self.view.frame.size.width, ((self.view.frame.size.height)/9)*2);
+        self.stampShapeViw.frame = CGRectMake(0, 240, self.view.frame.size.width, ((self.view.frame.size.height)/9)*2);
+        self.dateLabel.frame = CGRectMake(15, 430, 80, 50);
+        self.haveDateSwitch.frame = CGRectMake(self.view.frame.size.width - 75, 430, 60, 50);
+        self.timeLabel.frame = CGRectMake(15, 480, 100, 45);
+        self.haveTimeSwitch.frame = CGRectMake(self.view.frame.size.width - 75, 480, 60, 50);
+    }
+}
+
+- (void)willTransitionToTraitCollection:(UITraitCollection *)newCollection withTransitionCoordinator:(id<UIViewControllerTransitionCoordinator>)coordinator {
+    [super willTransitionToTraitCollection:newCollection withTransitionCoordinator:coordinator];
+    [self updatePreferredContentSizeWithTraitCollection:newCollection];
+}
+
+#pragma mark - Private Mthods
+
+- (void)updatePreferredContentSizeWithTraitCollection:(UITraitCollection *)traitCollection {
+    self.preferredContentSize = CGSizeMake(self.view.bounds.size.width, traitCollection.verticalSizeClass == UIUserInterfaceSizeClassCompact ? 350 : 560);
+}
+
+#pragma mark - Action
+
+- (void)buttonItemClicked_done:(id)sender {
+    if (![self.stampTextField.text isEqualToString:@""] || [self.haveDateSwitch isOn] || [self.haveTimeSwitch isOn])
+    {
+        NSMutableDictionary *tStampItem = [[NSMutableDictionary alloc] init];
+        
+        if (self.stampTextField.text.length > 0) {
+            [tStampItem setObject:self.stampTextField.text forKey:@"text"];
+            [tStampItem setObject:[NSNumber numberWithInteger:self.textStampStyle] forKey:@"style"];
+            [tStampItem setObject:[NSNumber numberWithBool:[self.haveDateSwitch isOn]] forKey:@"haveDate"];
+            [tStampItem setObject:[NSNumber numberWithBool:[self.haveTimeSwitch isOn]] forKey:@"haveTime"];
+        } else {
+            [tStampItem setObject:self.preView.dateTime forKey:@"text"];
+            [tStampItem setObject:[NSNumber numberWithInteger:self.textStampStyle] forKey:@"style"];
+            [tStampItem setObject:[NSNumber numberWithBool:NO] forKey:@"haveDate"];
+            [tStampItem setObject:[NSNumber numberWithBool:NO] forKey:@"haveTime"];
+        }
+        
+    }
+    [self dismissViewControllerAnimated:YES completion:nil];
+}
+
+- (void)buttonItemClicked_cancel:(id)sender {
+    [self dismissViewControllerAnimated:YES completion:nil];
+}
+
+- (void)textFieldEditChange:(id)sender {
+    UITextField *textField = (UITextField *)sender;
+    
+    self.preView.textStampText = textField.text;
+    [self.preView setNeedsDisplay];
+}
+
+- (void)switchChange_date:(id)sender {
+    self.preView.textStampHaveDate = [self.haveDateSwitch isOn];
+    [self.preView setNeedsDisplay];
+}
+
+- (void)switchChange_time:(id)sender {
+    self.preView.textStampHaveTime = [self.haveTimeSwitch isOn];
+    [self.preView setNeedsDisplay];
+}
+
+#pragma mark - CStampShapViewDelegate
+
+- (void)stampShapView:(CStampShapView *)stampShapView tag:(NSInteger)tag {
+    switch (tag) {
+        case TextStampTypeCenter:
+        {
+            self.preView.textStampStyle = TextStampTypeCenter;
+            self.textStampStyle = TextStampTypeCenter;
+            [self.preView setNeedsDisplay];
+        }
+            break;
+        case TextStampTypeLeft:
+        {
+            self.preView.textStampStyle = TextStampTypeLeft;
+            self.textStampStyle = TextStampTypeLeft;
+            [self.preView setNeedsDisplay];
+        }
+            break;
+        case TextStampTypeRight:
+        {
+            self.preView.textStampStyle = TextStampTypeRight;
+            self.textStampStyle = TextStampTypeRight;
+            [self.preView setNeedsDisplay];
+        }
+            break;
+        case TextStampTypeNone:
+        {
+            self.preView.textStampStyle = TextStampTypeNone;
+            self.textStampStyle = TextStampTypeNone;
+            [self.preView setNeedsDisplay];
+        }
+            break;
+    }
+}
+
+#pragma mark - CPDFColorSelectViewDelegate
+
+- (void)selectColorView:(CPDFColorSelectView *)select {
+    _colorPicker = [[CPDFColorPickerView alloc] initWithFrame:self.view.frame];
+    _colorPicker.delegate = self;
+    _colorView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
+    _colorPicker.backgroundColor = [UIColor whiteColor];
+    [self.view addSubview:self.colorPicker];
+}
+
+- (void)selectColorView:(CPDFColorSelectView *)select color:(UIColor *)color {
+    self.preView.color = color;
+    [self.preView setNeedsDisplay];
+}
+
+#pragma mark - CPDFColorPickerViewDelegate
+
+- (void)pickerView:(CPDFColorPickerView *)colorPickerView color:(UIColor *)color {
+    self.preView.color = color;
+    [self.preView setNeedsDisplay];
+}
+
+@end

+ 12 - 0
compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFStamp/Image.xcassets/CPDFStampTextImageCenter.imageset/Contents.json

@@ -0,0 +1,12 @@
+{
+  "images" : [
+    {
+      "filename" : "With Label.pdf",
+      "idiom" : "universal"
+    }
+  ],
+  "info" : {
+    "author" : "xcode",
+    "version" : 1
+  }
+}

+ 77 - 0
compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFStamp/Image.xcassets/CPDFStampTextImageCenter.imageset/With Label.pdf

@@ -0,0 +1,77 @@
+%PDF-1.7
+
+1 0 obj
+  << >>
+endobj
+
+2 0 obj
+  << /Length 3 0 R >>
+stream
+/DeviceRGB CS
+/DeviceRGB cs
+q
+1.000000 0.000000 -0.000000 1.000000 11.250000 13.250000 cm
+0.262745 0.278431 0.301961 scn
+17.500000 13.500000 m
+0.000000 13.500000 l
+0.000000 0.000000 l
+17.500000 0.000000 l
+17.500000 13.500000 l
+h
+16.000000 12.000000 m
+16.000000 1.500000 l
+1.500000 1.500000 l
+1.500000 12.000000 l
+16.000000 12.000000 l
+h
+f*
+n
+Q
+
+endstream
+endobj
+
+3 0 obj
+  344
+endobj
+
+4 0 obj
+  << /Annots []
+     /Type /Page
+     /MediaBox [ 0.000000 0.000000 40.000000 40.000000 ]
+     /Resources 1 0 R
+     /Contents 2 0 R
+     /Parent 5 0 R
+  >>
+endobj
+
+5 0 obj
+  << /Kids [ 4 0 R ]
+     /Count 1
+     /Type /Pages
+  >>
+endobj
+
+6 0 obj
+  << /Pages 5 0 R
+     /Type /Catalog
+  >>
+endobj
+
+xref
+0 7
+0000000000 65535 f
+0000000010 00000 n
+0000000034 00000 n
+0000000434 00000 n
+0000000456 00000 n
+0000000629 00000 n
+0000000703 00000 n
+trailer
+<< /ID [ (some) (id) ]
+   /Root 6 0 R
+   /Size 7
+>>
+startxref
+762
+%%EOF

+ 12 - 0
compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFStamp/Image.xcassets/CPDFStampTextImageLeft.imageset/Contents.json

@@ -0,0 +1,12 @@
+{
+  "images" : [
+    {
+      "filename" : "With Label (1).pdf",
+      "idiom" : "universal"
+    }
+  ],
+  "info" : {
+    "author" : "xcode",
+    "version" : 1
+  }
+}

+ 154 - 0
compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFStamp/Image.xcassets/CPDFStampTextImageLeft.imageset/With Label (1).pdf

@@ -0,0 +1,154 @@
+%PDF-1.7
+
+1 0 obj
+  << >>
+endobj
+
+2 0 obj
+  << /Length 3 0 R >>
+stream
+/DeviceRGB CS
+/DeviceRGB cs
+q
+16.200153 25.640184 m
+16.390148 25.868177 16.671595 26.000000 16.968374 26.000000 c
+27.500000 26.000000 l
+28.052284 26.000000 28.500000 25.552284 28.500000 25.000000 c
+28.500000 15.000000 l
+28.500000 14.447716 28.052284 14.000000 27.500000 14.000000 c
+16.968376 14.000000 l
+16.671597 14.000000 16.390148 14.131823 16.200153 14.359816 c
+12.033486 19.359816 l
+11.724448 19.730661 11.724449 20.269339 12.033487 20.640184 c
+16.200153 25.640184 l
+h
+W*
+n
+q
+1.000000 0.000000 -0.000000 1.000000 11.500000 14.000000 cm
+0.262745 0.278431 0.301961 scn
+0.533487 6.640184 m
+-0.618845 7.600461 l
+0.533487 6.640184 l
+h
+4.700154 0.359816 m
+3.547822 -0.600461 l
+3.547822 -0.600461 l
+4.700154 0.359816 l
+h
+4.700154 11.640184 m
+3.547822 12.600462 l
+4.700154 11.640184 l
+h
+5.468375 10.500000 m
+16.000000 10.500000 l
+16.000000 13.500000 l
+5.468375 13.500000 l
+5.468375 10.500000 l
+h
+15.500000 11.000000 m
+15.500000 1.000000 l
+18.500000 1.000000 l
+18.500000 11.000000 l
+15.500000 11.000000 l
+h
+16.000000 1.500000 m
+5.468375 1.500000 l
+5.468375 -1.500000 l
+16.000000 -1.500000 l
+16.000000 1.500000 l
+h
+5.852486 1.320092 m
+1.685819 6.320093 l
+-0.618845 4.399539 l
+3.547822 -0.600461 l
+5.852486 1.320092 l
+h
+1.685819 5.679908 m
+5.852486 10.679909 l
+3.547822 12.600462 l
+-0.618845 7.600461 l
+1.685819 5.679908 l
+h
+1.685819 6.320093 m
+1.840338 6.134669 1.840337 5.865330 1.685819 5.679908 c
+-0.618845 7.600461 l
+-1.391440 6.673347 -1.391442 5.326655 -0.618845 4.399539 c
+1.685819 6.320093 l
+h
+5.468375 1.500000 m
+5.616765 1.500000 5.757488 1.434089 5.852486 1.320092 c
+3.547822 -0.600461 l
+4.022807 -1.170443 4.726426 -1.500000 5.468375 -1.500000 c
+5.468375 1.500000 l
+h
+15.500000 1.000000 m
+15.500000 1.276143 15.723858 1.500000 16.000000 1.500000 c
+16.000000 -1.500000 l
+17.380711 -1.500000 18.500000 -0.380713 18.500000 1.000000 c
+15.500000 1.000000 l
+h
+16.000000 10.500000 m
+15.723857 10.500000 15.500000 10.723858 15.500000 11.000000 c
+18.500000 11.000000 l
+18.500000 12.380712 17.380713 13.500000 16.000000 13.500000 c
+16.000000 10.500000 l
+h
+5.468375 13.500000 m
+4.726426 13.500000 4.022807 13.170444 3.547822 12.600462 c
+5.852486 10.679909 l
+5.757488 10.565911 5.616764 10.500000 5.468375 10.500000 c
+5.468375 13.500000 l
+h
+f
+n
+Q
+Q
+
+endstream
+endobj
+
+3 0 obj
+  2244
+endobj
+
+4 0 obj
+  << /Annots []
+     /Type /Page
+     /MediaBox [ 0.000000 0.000000 40.000000 40.000000 ]
+     /Resources 1 0 R
+     /Contents 2 0 R
+     /Parent 5 0 R
+  >>
+endobj
+
+5 0 obj
+  << /Kids [ 4 0 R ]
+     /Count 1
+     /Type /Pages
+  >>
+endobj
+
+6 0 obj
+  << /Pages 5 0 R
+     /Type /Catalog
+  >>
+endobj
+
+xref
+0 7
+0000000000 65535 f
+0000000010 00000 n
+0000000034 00000 n
+0000002334 00000 n
+0000002357 00000 n
+0000002530 00000 n
+0000002604 00000 n
+trailer
+<< /ID [ (some) (id) ]
+   /Root 6 0 R
+   /Size 7
+>>
+startxref
+2663
+%%EOF

+ 12 - 0
compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFStamp/Image.xcassets/CPDFStampTextImageNone.imageset/Contents.json

@@ -0,0 +1,12 @@
+{
+  "images" : [
+    {
+      "filename" : "With Label (3).pdf",
+      "idiom" : "universal"
+    }
+  ],
+  "info" : {
+    "author" : "xcode",
+    "version" : 1
+  }
+}

+ 71 - 0
compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFStamp/Image.xcassets/CPDFStampTextImageNone.imageset/With Label (3).pdf

@@ -0,0 +1,71 @@
+%PDF-1.7
+
+1 0 obj
+  << >>
+endobj
+
+2 0 obj
+  << /Length 3 0 R >>
+stream
+/DeviceRGB CS
+/DeviceRGB cs
+q
+1.000000 0.000000 -0.000000 1.000000 12.469727 11.469727 cm
+0.262745 0.278431 0.301961 scn
+14.000000 15.060547 m
+15.060660 13.999887 l
+1.060660 -0.000113 l
+0.000000 1.060547 l
+14.000000 15.060547 l
+h
+f*
+n
+Q
+
+endstream
+endobj
+
+3 0 obj
+  237
+endobj
+
+4 0 obj
+  << /Annots []
+     /Type /Page
+     /MediaBox [ 0.000000 0.000000 40.000000 40.000000 ]
+     /Resources 1 0 R
+     /Contents 2 0 R
+     /Parent 5 0 R
+  >>
+endobj
+
+5 0 obj
+  << /Kids [ 4 0 R ]
+     /Count 1
+     /Type /Pages
+  >>
+endobj
+
+6 0 obj
+  << /Pages 5 0 R
+     /Type /Catalog
+  >>
+endobj
+
+xref
+0 7
+0000000000 65535 f
+0000000010 00000 n
+0000000034 00000 n
+0000000327 00000 n
+0000000349 00000 n
+0000000522 00000 n
+0000000596 00000 n
+trailer
+<< /ID [ (some) (id) ]
+   /Root 6 0 R
+   /Size 7
+>>
+startxref
+655
+%%EOF

+ 12 - 0
compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFStamp/Image.xcassets/CPDFStampTextImageRight.imageset/Contents.json

@@ -0,0 +1,12 @@
+{
+  "images" : [
+    {
+      "filename" : "With Label (2).pdf",
+      "idiom" : "universal"
+    }
+  ],
+  "info" : {
+    "author" : "xcode",
+    "version" : 1
+  }
+}

+ 170 - 0
compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFStamp/Image.xcassets/CPDFStampTextImageRight.imageset/With Label (2).pdf

@@ -0,0 +1,170 @@
+%PDF-1.7
+
+1 0 obj
+  << >>
+endobj
+
+2 0 obj
+  << /Length 3 0 R >>
+stream
+/DeviceRGB CS
+/DeviceRGB cs
+q
+1.000000 0.000000 -0.000000 1.000000 5.000000 5.000000 cm
+0.866667 0.912108 1.000000 scn
+0.000000 26.000000 m
+0.000000 28.209139 1.790861 30.000000 4.000000 30.000000 c
+26.000000 30.000000 l
+28.209139 30.000000 30.000000 28.209139 30.000000 26.000000 c
+30.000000 4.000000 l
+30.000000 1.790861 28.209139 0.000000 26.000000 0.000000 c
+4.000000 0.000000 l
+1.790861 0.000000 0.000000 1.790861 0.000000 4.000000 c
+0.000000 26.000000 l
+h
+f
+n
+Q
+q
+23.799847 25.640184 m
+23.609852 25.868177 23.328405 26.000000 23.031626 26.000000 c
+12.500000 26.000000 l
+11.947716 26.000000 11.500000 25.552284 11.500000 25.000000 c
+11.500000 15.000000 l
+11.500000 14.447716 11.947716 14.000000 12.500000 14.000000 c
+23.031624 14.000000 l
+23.328403 14.000000 23.609852 14.131823 23.799847 14.359816 c
+27.966513 19.359816 l
+28.275551 19.730661 28.275551 20.269339 27.966513 20.640184 c
+23.799847 25.640184 l
+h
+W*
+n
+q
+-1.000000 -0.000000 -0.000000 1.000000 28.500000 14.000000 cm
+0.262745 0.278431 0.301961 scn
+0.533487 6.640184 m
+-0.618845 7.600461 l
+0.533487 6.640184 l
+h
+4.700154 0.359816 m
+3.547822 -0.600461 l
+3.547822 -0.600461 l
+4.700154 0.359816 l
+h
+4.700154 11.640184 m
+3.547822 12.600462 l
+4.700154 11.640184 l
+h
+5.468375 10.500000 m
+16.000000 10.500000 l
+16.000000 13.500000 l
+5.468375 13.500000 l
+5.468375 10.500000 l
+h
+15.500000 11.000000 m
+15.500000 1.000000 l
+18.500000 1.000000 l
+18.500000 11.000000 l
+15.500000 11.000000 l
+h
+16.000000 1.500000 m
+5.468375 1.500000 l
+5.468375 -1.500000 l
+16.000000 -1.500000 l
+16.000000 1.500000 l
+h
+5.852486 1.320092 m
+1.685819 6.320093 l
+-0.618845 4.399539 l
+3.547822 -0.600461 l
+5.852486 1.320092 l
+h
+1.685819 5.679908 m
+5.852486 10.679909 l
+3.547822 12.600462 l
+-0.618845 7.600461 l
+1.685819 5.679908 l
+h
+1.685819 6.320093 m
+1.840338 6.134669 1.840337 5.865330 1.685819 5.679908 c
+-0.618845 7.600461 l
+-1.391440 6.673347 -1.391442 5.326655 -0.618845 4.399539 c
+1.685819 6.320093 l
+h
+5.468375 1.500000 m
+5.616765 1.500000 5.757488 1.434089 5.852486 1.320092 c
+3.547822 -0.600461 l
+4.022807 -1.170443 4.726426 -1.500000 5.468375 -1.500000 c
+5.468375 1.500000 l
+h
+15.500000 1.000000 m
+15.500000 1.276143 15.723858 1.500000 16.000000 1.500000 c
+16.000000 -1.500000 l
+17.380711 -1.500000 18.500000 -0.380713 18.500000 1.000000 c
+15.500000 1.000000 l
+h
+16.000000 10.500000 m
+15.723857 10.500000 15.500000 10.723858 15.500000 11.000000 c
+18.500000 11.000000 l
+18.500000 12.380712 17.380713 13.500000 16.000000 13.500000 c
+16.000000 10.500000 l
+h
+5.468375 13.500000 m
+4.726426 13.500000 4.022807 13.170444 3.547822 12.600462 c
+5.852486 10.679909 l
+5.757488 10.565911 5.616764 10.500000 5.468375 10.500000 c
+5.468375 13.500000 l
+h
+f
+n
+Q
+Q
+
+endstream
+endobj
+
+3 0 obj
+  2686
+endobj
+
+4 0 obj
+  << /Annots []
+     /Type /Page
+     /MediaBox [ 0.000000 0.000000 40.000000 40.000000 ]
+     /Resources 1 0 R
+     /Contents 2 0 R
+     /Parent 5 0 R
+  >>
+endobj
+
+5 0 obj
+  << /Kids [ 4 0 R ]
+     /Count 1
+     /Type /Pages
+  >>
+endobj
+
+6 0 obj
+  << /Pages 5 0 R
+     /Type /Catalog
+  >>
+endobj
+
+xref
+0 7
+0000000000 65535 f
+0000000010 00000 n
+0000000034 00000 n
+0000002776 00000 n
+0000002799 00000 n
+0000002972 00000 n
+0000003046 00000 n
+trailer
+<< /ID [ (some) (id) ]
+   /Root 6 0 R
+   /Size 7
+>>
+startxref
+3105
+%%EOF

+ 2 - 1
compdfkit-tools/compdfkit-tools/Common/Views/PDFAnnotationBar/CPDFAnnotationBar.m

@@ -31,6 +31,7 @@
 #import "CPDFStampViewController.h"
 #import "CSignatureManager.h"
 #import "CPDFColorUtils.h"
+#import "AAPLCustomPresentationController.h"
 
 #import <ComPDFKit/ComPDFKit.h>
 
@@ -425,7 +426,7 @@
         self.signatureVC.transitioningDelegate = presentationController;
         [self.parentVC presentViewController:self.signatureVC animated:YES completion:nil];
     } else if (CPDFViewAnnotationModeStamp == self.selectedIndex) {
-        CAnnotStyle *annotStytle = self.annotManage.annotStyle;
+//        CAnnotStyle *annotStytle = self.annotManage.annotStyle;
         AAPLCustomPresentationController *presentationController NS_VALID_UNTIL_END_OF_SCOPE;
         CPDFStampViewController *stampVC = [[CPDFStampViewController alloc] init];
         presentationController = [[AAPLCustomPresentationController alloc] initWithPresentedViewController:self.signatureVC presentingViewController:self.parentVC];

+ 1 - 1
compdfkit-tools/compdfkit-tools/Common/Views/PDFProperties/CPDFColorSelectView.m

@@ -97,7 +97,7 @@
 
 - (void)layoutSubviews {
     [super layoutSubviews];
-    self.colorLabel.frame = CGRectMake(5, 0, 50, self.bounds.size.height/3);
+    self.colorLabel.frame = CGRectMake(20, 0, 50, self.bounds.size.height/3);
     self.colorPickerView.frame = CGRectMake(0, self.bounds.size.height/3, self.bounds.size.width, (self.bounds.size.height/3)*2);
     [self pickerBarInit];
 }

+ 1 - 1
compdfkit-tools/compdfkit-tools/Common/Views/PDFProperties/CPDFOpacitySliderView.m

@@ -46,7 +46,7 @@
 
 - (void)layoutSubviews {
     [super layoutSubviews];
-    self.titleLabel.frame = CGRectMake(10, 0, 50, self.frame.size.height/2);
+    self.titleLabel.frame = CGRectMake(10, 0, self.frame.size.width, self.frame.size.height/2);
     self.opacitySlider.frame = CGRectMake(10, self.frame.size.height/2, self.frame.size.width - 110, self.frame.size.height/2);
     self.startLabel.frame = CGRectMake(self.frame.size.width - 90, self.frame.size.height/2 + 10, 80, self.frame.size.height/2 - 15);
 }

+ 1 - 1
compdfkit-tools/compdfkit-tools/Common/Views/PDFProperties/CPDFThicknessSliderView.m

@@ -45,7 +45,7 @@
 
 - (void)layoutSubviews {
     [super layoutSubviews];
-    self.titleLabel.frame = CGRectMake(10, 0, 70, self.frame.size.height/2);
+    self.titleLabel.frame = CGRectMake(10, 0, self.frame.size.width, self.frame.size.height/2);
     self.thicknessSlider.frame = CGRectMake(10, self.frame.size.height/2, self.frame.size.width - 110, self.frame.size.height/2);
     self.startLabel.frame = CGRectMake(self.frame.size.width - 90, self.frame.size.height/2 + 10, 80, self.frame.size.height/2 -15);
 }

+ 0 - 1
compdfkit-tools/compdfkit-tools/compdfkit_tools.h

@@ -60,7 +60,6 @@
 #import <compdfkit_tools/CPDFHighlightViewController.h>
 #import <compdfkit_tools/CPDFUnderlineViewController.h>
 #import <compdfkit_tools/CPDFStrikeoutViewController.h>
-#import <compdfkit_tools/AAPLCustomPresentationController.h>
 #import <compdfkit_tools/CPDFInkTopToolBar.h>
 #import <compdfkit_tools/CAnnotationManage.h>
 #import <compdfkit_tools/CPDFNoteOpenViewController.h>