Przeglądaj źródła

Merge branch 'compdfkit_demo_ios' of git.kdan.cc:others/kmpdfkit_demo into compdfkit_demo_ios

# Conflicts:
#	compdfkit-tools/compdfkit-tools.xcodeproj/project.pbxproj
chenyu 1 rok temu
rodzic
commit
957d816c46
100 zmienionych plików z 2260 dodań i 149 usunięć
  1. 0 4
      Annotation-Ctrl-Demo/Annotation-Ctrl-Demo/CPDFViewController.m
  2. 43 8
      compdfkit-tools/compdfkit-tools.xcodeproj/project.pbxproj
  3. 6 2
      compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFSignature/CPDFSignatureEditViewController.h
  4. 150 64
      compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFSignature/CPDFSignatureEditViewController.m
  5. 12 0
      compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFSignature/CPDFSignatureViewCell.h
  6. 20 0
      compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFSignature/CPDFSignatureViewCell.m
  7. 2 0
      compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFSignature/CPDFSignatureViewController.h
  8. 70 21
      compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFSignature/CPDFSignatureViewController.m
  9. 11 0
      compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFSignature/CSignatureDrawView.h
  10. 22 10
      compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFSignature/CSignatureDrawView.m
  11. 1 7
      compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFSignature/CSignatureTopBar.h
  12. 1 1
      compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFSignature/CSignatureTopBar.m
  13. 1 2
      compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFSignature/Image.xcassets/CPDFSignatureImageAdd.imageset/Contents.json
  14. 79 0
      compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFSignature/Image.xcassets/CPDFSignatureImageAdd.imageset/add.pdf
  15. BIN
      compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFSignature/Image.xcassets/CPDFSignatureImageAdd.imageset/signature_icon_add.png
  16. BIN
      compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFSignature/Image.xcassets/CPDFSignatureImageAdd.imageset/signature_icon_add@2x.png
  17. 21 0
      compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFSignature/Image.xcassets/CPDFSignatureImageDelete.imageset/Contents.json
  18. 103 0
      compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFSignature/Image.xcassets/CPDFSignatureImageDelete.imageset/delete.pdf
  19. 41 0
      compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFStamp/CPDFStampViewController.h
  20. 268 0
      compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFStamp/CPDFStampViewController.m
  21. 25 0
      compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFStamp/CStampButton.h
  22. 40 0
      compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFStamp/CStampButton.m
  23. 58 0
      compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFStamp/CStampCollectionViewCell.h
  24. 143 0
      compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFStamp/CStampCollectionViewCell.m
  25. 50 0
      compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFStamp/CStampFileManger.h
  26. 307 0
      compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFStamp/CStampFileManger.m
  27. 22 0
      compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFStamp/Image.xcassets/CPDFStampImage-01.imageset/Contents.json
  28. BIN
      compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFStamp/Image.xcassets/CPDFStampImage-01.imageset/stamp-01.png
  29. BIN
      compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFStamp/Image.xcassets/CPDFStampImage-01.imageset/stamp-01@2x.png
  30. 22 0
      compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFStamp/Image.xcassets/CPDFStampImage-02.imageset/Contents.json
  31. BIN
      compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFStamp/Image.xcassets/CPDFStampImage-02.imageset/stamp-02.png
  32. BIN
      compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFStamp/Image.xcassets/CPDFStampImage-02.imageset/stamp-02@2x.png
  33. 22 0
      compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFStamp/Image.xcassets/CPDFStampImage-03.imageset/Contents.json
  34. BIN
      compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFStamp/Image.xcassets/CPDFStampImage-03.imageset/stamp-03.png
  35. BIN
      compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFStamp/Image.xcassets/CPDFStampImage-03.imageset/stamp-03@2x.png
  36. 22 0
      compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFStamp/Image.xcassets/CPDFStampImage-04.imageset/Contents.json
  37. BIN
      compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFStamp/Image.xcassets/CPDFStampImage-04.imageset/stamp-04.png
  38. BIN
      compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFStamp/Image.xcassets/CPDFStampImage-04.imageset/stamp-04@2x.png
  39. 22 0
      compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFStamp/Image.xcassets/CPDFStampImage-05.imageset/Contents.json
  40. BIN
      compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFStamp/Image.xcassets/CPDFStampImage-05.imageset/stamp-05.png
  41. BIN
      compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFStamp/Image.xcassets/CPDFStampImage-05.imageset/stamp-05@2x.png
  42. 22 0
      compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFStamp/Image.xcassets/CPDFStampImage-06.imageset/Contents.json
  43. BIN
      compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFStamp/Image.xcassets/CPDFStampImage-06.imageset/stamp-06.png
  44. BIN
      compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFStamp/Image.xcassets/CPDFStampImage-06.imageset/stamp-06@2x.png
  45. 22 0
      compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFStamp/Image.xcassets/CPDFStampImage-07.imageset/Contents.json
  46. BIN
      compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFStamp/Image.xcassets/CPDFStampImage-07.imageset/stamp-07.png
  47. BIN
      compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFStamp/Image.xcassets/CPDFStampImage-07.imageset/stamp-07@2x.png
  48. 22 0
      compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFStamp/Image.xcassets/CPDFStampImage-08.imageset/Contents.json
  49. BIN
      compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFStamp/Image.xcassets/CPDFStampImage-08.imageset/stamp-08.png
  50. BIN
      compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFStamp/Image.xcassets/CPDFStampImage-08.imageset/stamp-08@2x.png
  51. 22 0
      compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFStamp/Image.xcassets/CPDFStampImage-09.imageset/Contents.json
  52. BIN
      compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFStamp/Image.xcassets/CPDFStampImage-09.imageset/stamp-09.png
  53. BIN
      compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFStamp/Image.xcassets/CPDFStampImage-09.imageset/stamp-09@2x.png
  54. 22 0
      compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFStamp/Image.xcassets/CPDFStampImage-10.imageset/Contents.json
  55. BIN
      compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFStamp/Image.xcassets/CPDFStampImage-10.imageset/stamp-10.png
  56. BIN
      compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFStamp/Image.xcassets/CPDFStampImage-10.imageset/stamp-10@2x.png
  57. 22 0
      compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFStamp/Image.xcassets/CPDFStampImage-11.imageset/Contents.json
  58. BIN
      compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFStamp/Image.xcassets/CPDFStampImage-11.imageset/stamp-11.png
  59. BIN
      compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFStamp/Image.xcassets/CPDFStampImage-11.imageset/stamp-11@2x.png
  60. 22 0
      compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFStamp/Image.xcassets/CPDFStampImage-12.imageset/Contents.json
  61. BIN
      compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFStamp/Image.xcassets/CPDFStampImage-12.imageset/stamp-12.png
  62. BIN
      compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFStamp/Image.xcassets/CPDFStampImage-12.imageset/stamp-12@2x.png
  63. 22 0
      compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFStamp/Image.xcassets/CPDFStampImage-13.imageset/Contents.json
  64. BIN
      compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFStamp/Image.xcassets/CPDFStampImage-13.imageset/stamp-13.png
  65. BIN
      compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFStamp/Image.xcassets/CPDFStampImage-13.imageset/stamp-13@2x.png
  66. 22 0
      compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFStamp/Image.xcassets/CPDFStampImage-14.imageset/Contents.json
  67. BIN
      compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFStamp/Image.xcassets/CPDFStampImage-14.imageset/stamp-14.png
  68. BIN
      compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFStamp/Image.xcassets/CPDFStampImage-14.imageset/stamp-14@2x.png
  69. 22 0
      compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFStamp/Image.xcassets/CPDFStampImage-15.imageset/Contents.json
  70. BIN
      compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFStamp/Image.xcassets/CPDFStampImage-15.imageset/stamp-15.png
  71. BIN
      compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFStamp/Image.xcassets/CPDFStampImage-15.imageset/stamp-15@2x.png
  72. 22 0
      compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFStamp/Image.xcassets/CPDFStampImage-16.imageset/Contents.json
  73. BIN
      compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFStamp/Image.xcassets/CPDFStampImage-16.imageset/stamp-16.png
  74. BIN
      compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFStamp/Image.xcassets/CPDFStampImage-16.imageset/stamp-16@2x.png
  75. 22 0
      compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFStamp/Image.xcassets/CPDFStampImage-18.imageset/Contents.json
  76. BIN
      compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFStamp/Image.xcassets/CPDFStampImage-18.imageset/stamp-18.png
  77. BIN
      compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFStamp/Image.xcassets/CPDFStampImage-18.imageset/stamp-18@2x.png
  78. 22 0
      compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFStamp/Image.xcassets/CPDFStampImage-20.imageset/Contents.json
  79. BIN
      compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFStamp/Image.xcassets/CPDFStampImage-20.imageset/stamp-20.png
  80. BIN
      compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFStamp/Image.xcassets/CPDFStampImage-20.imageset/stamp-20@2x.png
  81. 21 0
      compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFStamp/Image.xcassets/CPDFStampImageImage.imageset/Contents.json
  82. 99 0
      compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFStamp/Image.xcassets/CPDFStampImageImage.imageset/Group (1).pdf
  83. 21 0
      compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFStamp/Image.xcassets/CPDFStampImageText.imageset/Contents.json
  84. 95 0
      compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFStamp/Image.xcassets/CPDFStampImageText.imageset/Group.pdf
  85. 22 0
      compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFStamp/Image.xcassets/CPDFStampImage_chick.imageset/Contents.json
  86. BIN
      compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFStamp/Image.xcassets/CPDFStampImage_chick.imageset/stamp_chick.png
  87. BIN
      compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFStamp/Image.xcassets/CPDFStampImage_chick.imageset/stamp_chick@2x.png
  88. 22 0
      compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFStamp/Image.xcassets/CPDFStampImage_circle.imageset/Contents.json
  89. BIN
      compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFStamp/Image.xcassets/CPDFStampImage_circle.imageset/stamp_circle_01.png
  90. BIN
      compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFStamp/Image.xcassets/CPDFStampImage_circle.imageset/stamp_circle_01@2x.png
  91. 22 0
      compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFStamp/Image.xcassets/CPDFStampImage_cross.imageset/Contents.json
  92. BIN
      compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFStamp/Image.xcassets/CPDFStampImage_cross.imageset/stamp_cross.png
  93. BIN
      compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFStamp/Image.xcassets/CPDFStampImage_cross.imageset/stamp_cross@2x.png
  94. 6 0
      compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFStamp/Image.xcassets/Contents.json
  95. 2 2
      compdfkit-tools/compdfkit-tools/Common/Controls/BOTA/CPDFBOTAViewController.m
  96. 25 17
      compdfkit-tools/compdfkit-tools/Common/Views/PDFAnnotationBar/CPDFAnnotationBar.m
  97. 52 7
      compdfkit-tools/compdfkit-tools/Common/Views/PDFProperties/CPDFAnnotationSampleView.m
  98. 1 0
      compdfkit-tools/compdfkit-tools/Common/Views/PDFProperties/CPDFColorSelectView.m
  99. 2 4
      compdfkit-tools/compdfkit-tools/Common/Views/PDFProperties/CPDFOpacitySliderView.m
  100. 0 0
      compdfkit-tools/compdfkit-tools/Common/Views/PDFProperties/CPDFThicknessSliderView.m

+ 0 - 4
Annotation-Ctrl-Demo/Annotation-Ctrl-Demo/CPDFViewController.m

@@ -247,10 +247,6 @@
     [self.annotationBar reloadData];
 }
 
-- (void)PDFListViewChangeatioActiveAnnotations:(CPDFListView *)pdfListView forActiveAnnotations:(NSArray<CPDFAnnotation *> *)annotations {
-    self.annotationManage = [[CAnnotationManage alloc] initWithPDFView:pdfListView];
-}
-
 - (void)PDFListViewPerformAddStamp:(CPDFListView *)pdfView atPoint:(CGPoint)point forPage:(CPDFPage *)page {
     
 }

+ 43 - 8
compdfkit-tools/compdfkit-tools.xcodeproj/project.pbxproj

@@ -92,8 +92,6 @@
 		C91BE7DF2A03CF080038F2BC /* Image.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = C91BE7DE2A03CF080038F2BC /* Image.xcassets */; };
 		C91BE7E22A048F1A0038F2BC /* CSignatureManager.h in Headers */ = {isa = PBXBuildFile; fileRef = C91BE7E02A048F1A0038F2BC /* CSignatureManager.h */; };
 		C91BE7E32A048F1A0038F2BC /* CSignatureManager.m in Sources */ = {isa = PBXBuildFile; fileRef = C91BE7E12A048F1A0038F2BC /* CSignatureManager.m */; };
-		C91BE7E62A04AD880038F2BC /* CSignatureTopBar.h in Headers */ = {isa = PBXBuildFile; fileRef = C91BE7E42A04AD880038F2BC /* CSignatureTopBar.h */; };
-		C91BE7E72A04AD880038F2BC /* CSignatureTopBar.m in Sources */ = {isa = PBXBuildFile; fileRef = C91BE7E52A04AD880038F2BC /* CSignatureTopBar.m */; };
 		C91BE7EE2A04AED50038F2BC /* CSignatureDrawView.h in Headers */ = {isa = PBXBuildFile; fileRef = C91BE7EC2A04AED50038F2BC /* CSignatureDrawView.h */; };
 		C91BE7EF2A04AED50038F2BC /* CSignatureDrawView.m in Sources */ = {isa = PBXBuildFile; fileRef = C91BE7ED2A04AED50038F2BC /* CSignatureDrawView.m */; };
 		C9AF182629EE8AB600EC4979 /* UtilsColor.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = C9AF182529EE8AB600EC4979 /* UtilsColor.xcassets */; };
@@ -121,6 +119,15 @@
 		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 */; };
+		C9FBA20E2A0D1119003FABEC /* CPDFStampViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = C9FBA20C2A0D1119003FABEC /* CPDFStampViewController.h */; };
+		C9FBA20F2A0D1119003FABEC /* CPDFStampViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = C9FBA20D2A0D1119003FABEC /* CPDFStampViewController.m */; };
+		C9FBA2122A0D1172003FABEC /* CStampCollectionViewCell.h in Headers */ = {isa = PBXBuildFile; fileRef = C9FBA2102A0D1172003FABEC /* CStampCollectionViewCell.h */; };
+		C9FBA2132A0D1172003FABEC /* CStampCollectionViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = C9FBA2112A0D1172003FABEC /* CStampCollectionViewCell.m */; };
+		C9FBA2162A0D11C7003FABEC /* CStampFileManger.h in Headers */ = {isa = PBXBuildFile; fileRef = C9FBA2142A0D11C7003FABEC /* CStampFileManger.h */; };
+		C9FBA2172A0D11C7003FABEC /* CStampFileManger.m in Sources */ = {isa = PBXBuildFile; fileRef = C9FBA2152A0D11C7003FABEC /* CStampFileManger.m */; };
+		C9FBA2192A0DD277003FABEC /* Image.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = C9FBA2182A0DD277003FABEC /* Image.xcassets */; };
+		C9FBA21C2A0E2FB6003FABEC /* CStampButton.h in Headers */ = {isa = PBXBuildFile; fileRef = C9FBA21A2A0E2FB6003FABEC /* CStampButton.h */; };
+		C9FBA21D2A0E2FB6003FABEC /* CStampButton.m in Sources */ = {isa = PBXBuildFile; fileRef = C9FBA21B2A0E2FB6003FABEC /* CStampButton.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 */; };
@@ -299,8 +306,6 @@
 		C91BE7DE2A03CF080038F2BC /* Image.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Image.xcassets; sourceTree = "<group>"; };
 		C91BE7E02A048F1A0038F2BC /* CSignatureManager.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CSignatureManager.h; sourceTree = "<group>"; };
 		C91BE7E12A048F1A0038F2BC /* CSignatureManager.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = CSignatureManager.m; sourceTree = "<group>"; };
-		C91BE7E42A04AD880038F2BC /* CSignatureTopBar.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CSignatureTopBar.h; sourceTree = "<group>"; };
-		C91BE7E52A04AD880038F2BC /* CSignatureTopBar.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = CSignatureTopBar.m; sourceTree = "<group>"; };
 		C91BE7EC2A04AED50038F2BC /* CSignatureDrawView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CSignatureDrawView.h; sourceTree = "<group>"; };
 		C91BE7ED2A04AED50038F2BC /* CSignatureDrawView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = CSignatureDrawView.m; sourceTree = "<group>"; };
 		C9AF182529EE8AB600EC4979 /* UtilsColor.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = UtilsColor.xcassets; sourceTree = "<group>"; };
@@ -329,6 +334,15 @@
 		C9B9EC4F29F52DCC00C6A5D2 /* AAPLCustomPresentationController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AAPLCustomPresentationController.m; sourceTree = "<group>"; };
 		C9B9EC5729F54E9600C6A5D2 /* CAnnotStyle.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CAnnotStyle.h; sourceTree = "<group>"; };
 		C9B9EC5829F54E9600C6A5D2 /* CAnnotStyle.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = CAnnotStyle.m; sourceTree = "<group>"; };
+		C9FBA20C2A0D1119003FABEC /* CPDFStampViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CPDFStampViewController.h; sourceTree = "<group>"; };
+		C9FBA20D2A0D1119003FABEC /* CPDFStampViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = CPDFStampViewController.m; sourceTree = "<group>"; };
+		C9FBA2102A0D1172003FABEC /* CStampCollectionViewCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CStampCollectionViewCell.h; sourceTree = "<group>"; };
+		C9FBA2112A0D1172003FABEC /* CStampCollectionViewCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = CStampCollectionViewCell.m; sourceTree = "<group>"; };
+		C9FBA2142A0D11C7003FABEC /* CStampFileManger.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CStampFileManger.h; sourceTree = "<group>"; };
+		C9FBA2152A0D11C7003FABEC /* CStampFileManger.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = CStampFileManger.m; sourceTree = "<group>"; };
+		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>"; };
 		F313657129E4367A00EE6BBB /* ComPDFKit.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = ComPDFKit.xcframework; path = ../Lib/ComPDFKit.xcframework; sourceTree = "<group>"; };
 		F32DA12229ED904300E19ECA /* CPDFOutlineModel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CPDFOutlineModel.h; sourceTree = "<group>"; };
 		F32DA12329ED904300E19ECA /* Image.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Image.xcassets; sourceTree = "<group>"; };
@@ -614,8 +628,6 @@
 				C91BE7DB2A039E900038F2BC /* CPDFSignatureEditViewController.m */,
 				C91BE7E02A048F1A0038F2BC /* CSignatureManager.h */,
 				C91BE7E12A048F1A0038F2BC /* CSignatureManager.m */,
-				C91BE7E42A04AD880038F2BC /* CSignatureTopBar.h */,
-				C91BE7E52A04AD880038F2BC /* CSignatureTopBar.m */,
 				C91BE7EC2A04AED50038F2BC /* CSignatureDrawView.h */,
 				C91BE7ED2A04AED50038F2BC /* CSignatureDrawView.m */,
 				C91BE7DE2A03CF080038F2BC /* Image.xcassets */,
@@ -682,6 +694,7 @@
 		C9AF188A29F4C7C900EC4979 /* PDFProperties */ = {
 			isa = PBXGroup;
 			children = (
+				C9FBA20B2A0D10C3003FABEC /* PDFStamp */,
 				F350B3472A09EAD400B4FC8F /* PDFSound */,
 				C91BE7D12A0399F40038F2BC /* PDFSignature */,
 				C91BE7C02A0234CB0038F2BC /* PDFFreeText */,
@@ -748,6 +761,22 @@
 			path = Model;
 			sourceTree = "<group>";
 		};
+		C9FBA20B2A0D10C3003FABEC /* PDFStamp */ = {
+			isa = PBXGroup;
+			children = (
+				C9FBA20C2A0D1119003FABEC /* CPDFStampViewController.h */,
+				C9FBA20D2A0D1119003FABEC /* CPDFStampViewController.m */,
+				C9FBA2102A0D1172003FABEC /* CStampCollectionViewCell.h */,
+				C9FBA2112A0D1172003FABEC /* CStampCollectionViewCell.m */,
+				C9FBA2142A0D11C7003FABEC /* CStampFileManger.h */,
+				C9FBA2152A0D11C7003FABEC /* CStampFileManger.m */,
+				C9FBA21A2A0E2FB6003FABEC /* CStampButton.h */,
+				C9FBA21B2A0E2FB6003FABEC /* CStampButton.m */,
+				C9FBA2182A0DD277003FABEC /* Image.xcassets */,
+			);
+			path = PDFStamp;
+			sourceTree = "<group>";
+		};
 		F313657029E4367A00EE6BBB /* Frameworks */ = {
 			isa = PBXGroup;
 			children = (
@@ -1081,6 +1110,7 @@
 				4F5986912A03411700F06A1B /* CPDFDropDownMenu.h in Headers */,
 				F32DA18529ED904300E19ECA /* CActivityIndicatorView.h in Headers */,
 				F350B34B2A09EAF100B4FC8F /* CPDFMediaManager.h in Headers */,
+				C9FBA21C2A0E2FB6003FABEC /* CStampButton.h in Headers */,
 				4F06AB5529F6792E007797E4 /* CPDFEditToolBar.h in Headers */,
 				F32DA17E29ED904300E19ECA /* CPDFBOTAViewController.h in Headers */,
 				F32DA16829ED904300E19ECA /* CPDFOutlineViewCell.h in Headers */,
@@ -1132,12 +1162,13 @@
 				C9AF182C29EFB1FC00EC4979 /* CPDFBookmarkViewCell.h in Headers */,
 				4F1131AF29F8EEA800950564 /* CPDFEditViewController.h in Headers */,
 				F32DA16529ED904300E19ECA /* CPDFOutlineViewController.h in Headers */,
+				C9FBA2162A0D11C7003FABEC /* CStampFileManger.h in Headers */,
 				4F06AB5729F6792E007797E4 /* CPDFImageProperty.h in Headers */,
 				F35DD19D2A06850700B57F5B /* CPDFLineAnnotation+PDFListView.h in Headers */,
 				F3DF83D42A0BB9BA00D4F3AF /* CStringConstants.h in Headers */,
 				C918CEA029F8F74000D43974 /* CPDFStrikeoutViewController.h in Headers */,
-				C91BE7E62A04AD880038F2BC /* CSignatureTopBar.h in Headers */,
 				F38F60C629EFF0C2008098F8 /* CPDFColorUtils.h in Headers */,
+				C9FBA20E2A0D1119003FABEC /* CPDFStampViewController.h in Headers */,
 				C9AF189B29F4DBF800EC4979 /* CPDFOpacitySliderView.h in Headers */,
 				C918CE9229F7C3FB00D43974 /* CAnnotationManage.h in Headers */,
 				4F1131B429F90E7200950564 /* CPDFImagePropertyCell.h in Headers */,
@@ -1156,6 +1187,7 @@
 				4F1131BA29F911A800950564 /* CPDFTextPropertyCell.h in Headers */,
 				C9AF188E29F4C8A900EC4979 /* CPDFAnnotationBaseViewController.h in Headers */,
 				F335EE4B29E430C800ACC72A /* compdfkit_tools.h in Headers */,
+				C9FBA2122A0D1172003FABEC /* CStampCollectionViewCell.h in Headers */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};
@@ -1258,6 +1290,7 @@
 				4F1131BB29F911A800950564 /* CPDFTextPropertyCell.m in Sources */,
 				F35DD1A02A06850700B57F5B /* CPDFAnnotation+PDFListView.m in Sources */,
 				F350B34A2A09EAF100B4FC8F /* CPDFMediaManager.m in Sources */,
+				C9FBA2172A0D11C7003FABEC /* CStampFileManger.m in Sources */,
 				F32DA17F29ED904300E19ECA /* CNavigationController.m in Sources */,
 				F382636D29EFD0D9003F1DFD /* CPDFListView.m in Sources */,
 				F38F5B672A03D68100D0EEFD /* CPDFListMagnifierView.m in Sources */,
@@ -1278,6 +1311,8 @@
 				4F5986922A03411700F06A1B /* CPDFDropDownMenu.m in Sources */,
 				4FD34DD12A0B3F51005CEAB6 /* CPDFPopMenu.m in Sources */,
 				F32DA16429ED904300E19ECA /* CPDFOutlineViewCell.m in Sources */,
+				C9FBA2132A0D1172003FABEC /* CStampCollectionViewCell.m in Sources */,
+				C9FBA20F2A0D1119003FABEC /* CPDFStampViewController.m in Sources */,
 				F35DD1992A06850700B57F5B /* CPDFCircleAnnotation+PDFListView.m in Sources */,
 				F382636A29EFD0D9003F1DFD /* CPDFSlider.m in Sources */,
 				4F06AB5029F6792E007797E4 /* CPDFTextProperty.m in Sources */,
@@ -1305,9 +1340,9 @@
 				C918CECA29FA140C00D43974 /* CPDFInkViewController.m in Sources */,
 				F382636929EFD0D9003F1DFD /* CPDFPageIndicatorView.m in Sources */,
 				C91BE7DD2A039E900038F2BC /* CPDFSignatureEditViewController.m in Sources */,
+				C9FBA21D2A0E2FB6003FABEC /* CStampButton.m in Sources */,
 				F32DA17229ED904300E19ECA /* CPDFThumbnailViewCell.m in Sources */,
 				F32DA18429ED904300E19ECA /* CActivityIndicatorView.m in Sources */,
-				C91BE7E72A04AD880038F2BC /* CSignatureTopBar.m in Sources */,
 				4F6C796B29FBD532008C9501 /* CPDFEditFontNameSelectView.m in Sources */,
 				F32DA18329ED904300E19ECA /* CNavigationRightView.m in Sources */,
 				F35DD1A12A06850700B57F5B /* CPDFSquareAnnotation+PDFListView.m in Sources */,

+ 6 - 2
compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFSignature/CPDFSignatureEditViewController.h

@@ -14,6 +14,12 @@
 
 NS_ASSUME_NONNULL_BEGIN
 
+typedef NS_ENUM(NSInteger, CSignatureTopBarSelectedIndex) {
+    CSignatureTopBarDefault = 0,
+    CSignatureTopBarText,
+    CSignatureTopBarImage
+};
+
 @class CPDFSignatureEditViewController;
 
 @protocol CPDFSignatureEditViewControllerDelegate <NSObject>
@@ -22,8 +28,6 @@ NS_ASSUME_NONNULL_BEGIN
 
 - (void)signatureEditViewController:(CPDFSignatureEditViewController *)signatureEditViewController image:(UIImage *)image;
 
-- (void)signatureEditViewController:(CPDFSignatureEditViewController *)signatureEditViewController text:(NSString *)text;
-
 @end
 
 @interface CPDFSignatureEditViewController : UIViewController

+ 150 - 64
compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFSignature/CPDFSignatureEditViewController.m

@@ -16,7 +16,7 @@
 #import "CSignatureTopBar.h"
 #import "CSignatureDrawView.h"
 
-@interface CPDFSignatureEditViewController () <CSignatureTopBarDelegate, CPDFColorSelectViewDelegate, UIPopoverPresentationControllerDelegate, UINavigationControllerDelegate, UIImagePickerControllerDelegate>
+@interface CPDFSignatureEditViewController () <UIPopoverPresentationControllerDelegate, UINavigationControllerDelegate, UIImagePickerControllerDelegate, CPDFColorSelectViewDelegate, CPDFColorPickerViewDelegate>
 
 @property (nonatomic, strong) CPDFColorSelectView *colorSelectView;
 
@@ -24,14 +24,20 @@
 
 @property (nonatomic, strong) UIButton *saveButton;
 
-@property (nonatomic, strong) CSignatureTopBar *topBar;
+@property (nonatomic, strong) UISegmentedControl *segmentedControl;
 
-@property (nonatomic, strong) CSignatureDrawView *signatureDrawView;
+@property (nonatomic, strong) CSignatureDrawView *signatureDrawTextView;
+
+@property (nonatomic, strong) CSignatureDrawView *signatureDrawImageView;
+
+@property (nonatomic, strong) CPDFColorPickerView *colorPicker;
 
 @property (nonatomic, strong) UITextField *textField;
 
 @property (nonatomic, strong) CALayer *bottomBorder;
 
+@property (nonatomic, strong) UIButton *createButton;
+
 @property (nonatomic, assign) CSignatureTopBarSelectedIndex selecIndex;
 
 @end
@@ -45,14 +51,24 @@
     // Do any additional setup after loading the view.
     self.title = NSLocalizedString(@"Add Signature", nil);
     
-    self.topBar = [[CSignatureTopBar alloc] init];
-    self.topBar.delegate = self;
-    [self.view addSubview:self.topBar];
+    NSArray *segmmentArray = [NSArray arrayWithObjects:NSLocalizedString(@"Draw", nil), NSLocalizedString(@"Text", nil), NSLocalizedString(@"Image", nil),nil];
+    _segmentedControl = [[UISegmentedControl alloc] initWithItems:segmmentArray];
+    _segmentedControl.selectedSegmentIndex = 0;
+    _segmentedControl.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
+    [_segmentedControl addTarget:self action:@selector(segmentedControlValueChanged_singature:) forControlEvents:UIControlEventValueChanged];
+    self.navigationItem.titleView = self.segmentedControl;
     
-    self.signatureDrawView = [[CSignatureDrawView alloc] init];
-    self.signatureDrawView.color = [UIColor blackColor];
-    self.signatureDrawView.lineWidth = 4;
-    [self.view addSubview:self.signatureDrawView];
+    self.signatureDrawTextView = [[CSignatureDrawView alloc] init];
+    self.signatureDrawTextView.color = [UIColor blackColor];
+    self.signatureDrawTextView.autoresizingMask = UIViewAutoresizingFlexibleHeight;
+    self.signatureDrawTextView.lineWidth = 4;
+    [self.view addSubview:self.signatureDrawTextView];
+    
+    self.signatureDrawImageView = [[CSignatureDrawView alloc] init];
+    self.signatureDrawImageView.color = [UIColor blackColor];
+    self.signatureDrawImageView.lineWidth = 4;
+    [self.view addSubview:self.signatureDrawImageView];
+    self.signatureDrawImageView.hidden = YES;
     
     self.colorSelectView = [[CPDFColorSelectView alloc] initWithFrame:CGRectMake(0, 550, self.view.frame.size.width, 90)];
     self.colorSelectView.delegate = self;
@@ -61,23 +77,17 @@
     
     self.cacelButon = [[UIButton alloc] init];
     [self.cacelButon setTitle:NSLocalizedString(@"Cancel", nil) forState:UIControlStateNormal];
-    self.cacelButon.layer.borderColor = [UIColor purpleColor].CGColor;
-    self.cacelButon.layer.borderWidth = 1.0;
-    self.cacelButon.layer.cornerRadius = 10.0;
-    self.cacelButon.layer.masksToBounds = YES;
     [self.cacelButon setTitleColor:[UIColor redColor] forState:UIControlStateNormal];
     [self.cacelButon addTarget:self action:@selector(buttonItemClicked_Cancel:) forControlEvents:UIControlEventTouchUpInside];
-    [self.view addSubview:self.cacelButon];
+    UIBarButtonItem *cancelItem = [[UIBarButtonItem alloc] initWithCustomView:self.cacelButon];
+    self.navigationItem.leftBarButtonItem = cancelItem;
     
     self.saveButton = [[UIButton alloc] init];
-    [self.saveButton setTitle:NSLocalizedString(@"Save", nil) forState:UIControlStateNormal];
-    self.saveButton.layer.borderColor = [UIColor purpleColor].CGColor;
-    self.saveButton.layer.borderWidth = 1.0;
-    self.saveButton.layer.cornerRadius = 10.0;
-    self.saveButton.layer.masksToBounds = YES;
+    [self.saveButton setTitle:NSLocalizedString(@"Done", nil) forState:UIControlStateNormal];
     [self.saveButton setTitleColor:[UIColor blueColor] forState:UIControlStateNormal];
     [self.saveButton addTarget:self action:@selector(buttonItemClicked_Save:) forControlEvents:UIControlEventTouchUpInside];
-    [self.view addSubview:self.saveButton];
+    UIBarButtonItem *doneItem = [[UIBarButtonItem alloc] initWithCustomView:self.saveButton];
+    self.navigationItem.rightBarButtonItem = doneItem;
     
     self.bottomBorder = [CALayer layer];
     self.bottomBorder.backgroundColor = [UIColor blackColor].CGColor;
@@ -88,70 +98,89 @@
     [self.textField.layer addSublayer:self.bottomBorder];
     self.textField.hidden = YES;
     
+    self.createButton = [[UIButton alloc] init];
+    self.createButton.layer.cornerRadius = 25.0;
+    self.createButton.clipsToBounds = YES;
+    [self.createButton setImage:[UIImage imageNamed:@"CPDFSignatureImageAdd" inBundle:[NSBundle bundleForClass:self.class] compatibleWithTraitCollection:nil] forState:UIControlStateNormal];
+    self.createButton.backgroundColor = [UIColor blueColor];
+    [self.createButton addTarget:self action:@selector(buttonItemClicked_create:) forControlEvents:UIControlEventTouchUpInside];
+    [self.view addSubview:self.createButton];
+    self.createButton.hidden = YES;
+    
     self.selecIndex = CSignatureTopBarDefault;
+    [self createGestureRecognizer];
 }
 
 - (void)viewWillLayoutSubviews {
     [super viewWillLayoutSubviews];
+    self.colorPicker.frame = CGRectMake(0, self.view.frame.size.height/2, self.view.frame.size.width, self.view.frame.size.height/2);
     if (@available(iOS 11.0, *)) {
-        self.topBar.frame = CGRectMake(0, self.view.safeAreaInsets.top, self.view.frame.size.width, 50);
+        self.colorSelectView.frame = CGRectMake(0, self.view.safeAreaInsets.top, self.view.frame.size.width, 90);
+        self.signatureDrawTextView.frame = CGRectMake(self.view.safeAreaInsets.left, self.view.safeAreaInsets.top + 90, self.view.frame.size.width - self.view.safeAreaInsets.left - self.view.safeAreaInsets.right, self.view.frame.size.height/2);
+        self.signatureDrawImageView.frame = self.signatureDrawTextView.frame;
+        self.createButton.frame = CGRectMake(self.view.frame.size.width - 70 - self.view.safeAreaInsets.right, self.view.frame.size.height - 100 - self.view.safeAreaInsets.bottom, 50, 50);
     } else {
-        self.topBar.frame = CGRectMake(0, 64, self.view.frame.size.width, 50);
+        self.colorSelectView.frame = CGRectMake(0, 64, self.view.frame.size.width, 90);
+        self.signatureDrawTextView.frame = CGRectMake(0, 190, self.view.frame.size.width, self.view.frame.size.height/2);
+        self.signatureDrawImageView.frame = self.signatureDrawTextView.frame;
+        self.createButton.frame = CGRectMake(self.view.frame.size.width - 70, self.view.frame.size.height - 100, 50, 50);
     }
-    self.signatureDrawView.frame = CGRectMake(0, 150, self.view.frame.size.width, self.view.frame.size.height/2);
-    self.cacelButon.frame = CGRectMake(80, 700, 90, 50);
-    self.saveButton.frame = CGRectMake(self.view.frame.size.width - 170, 700, 90, 50);
+    
     self.textField.frame = CGRectMake((self.view.frame.size.width - 300)/2, 200, 300, 100);
     self.bottomBorder.frame = CGRectMake(0, self.textField.frame.size.height - 1, self.textField.frame.size.width, 1.0);
 }
 
-#pragma mark - CSignatureTopBarDelegate
+- (void)viewWillTransitionToSize:(CGSize)size withTransitionCoordinator:(id<UIViewControllerTransitionCoordinator>)coordinator {
+    [self.signatureDrawTextView signatureClear];
+}
 
-- (void)signatureTopBar:(CSignatureTopBar *)signatureTopBar selectIndex:(CSignatureTopBarSelectedIndex)selectIndex {
-    switch (selectIndex) {
-        case CSignatureTopBarDefault:
-        {
-            self.colorSelectView.hidden = NO;
-            self.signatureDrawView.hidden = NO;
-            self.textField.hidden = YES;
-            self.selecIndex = CSignatureTopBarDefault;
-        }
-            break;
-        case CSignatureTopBarText:
-        {
-            self.colorSelectView.hidden = NO;
-            self.signatureDrawView.hidden = YES;
-            self.textField.hidden = NO;
-            self.selecIndex = CSignatureTopBarText;
-        }
-            break;
-        case CSignatureTopBarImage:
-        {
-            self.colorSelectView.hidden = YES;
-            self.signatureDrawView.hidden = NO;
-            self.textField.hidden = YES;
-            self.selecIndex = CSignatureTopBarImage;
-            [self createImageSignature];
-        }
-            break;
-            
-        default:
-            break;
+#pragma mark - Private Methods
+
+- (void)createGestureRecognizer {
+    [self.createButton setUserInteractionEnabled:YES];
+
+    UIPanGestureRecognizer *panRecognizer = [[UIPanGestureRecognizer alloc] initWithTarget:self action:@selector(panaddBookmarkBtn:)];
+    [self.createButton addGestureRecognizer:panRecognizer];
+}
+
+- (void)panaddBookmarkBtn:(UIPanGestureRecognizer *)gestureRecognizer {
+    CGPoint point = [gestureRecognizer translationInView:self.view];
+    CGFloat newX = self.createButton.center.x + point.x;
+    CGFloat newY = self.createButton.center.y + point.y;
+    if (CGRectContainsPoint(self.view.frame, CGPointMake(newX, newY))) {
+        self.createButton.center = CGPointMake(newX, newY);
     }
+    [gestureRecognizer setTranslation:CGPointZero inView:self.view];
+}
+
+- (UIImage *)captureScreenshotOfTextField:(UITextField *)textField {
+    textField.tintColor = [UIColor whiteColor];
+    CGRect textRect = [textField textRectForBounds:CGRectInset(textField.bounds, 0, 1)];
+    UIGraphicsBeginImageContextWithOptions(textRect.size, NO, 0.0);
+    [textField drawViewHierarchyInRect:textField.bounds afterScreenUpdates:YES];
+    UIImage *textFieldImage = UIGraphicsGetImageFromCurrentImageContext();
+    UIGraphicsEndImageContext();
+    return textFieldImage;
 }
 
 #pragma mark - Action
 
 - (void)buttonItemClicked_Save:(id)sender {
-    if ((CSignatureTopBarDefault == self.selecIndex) || (CSignatureTopBarImage == self.selecIndex)) {
-        UIImage *image = [self.signatureDrawView signatureImage];
+    if (CSignatureTopBarDefault == self.selecIndex) {
+        UIImage *image = [self.signatureDrawTextView signatureImage];
         if (self.delegate && [self.delegate respondsToSelector:@selector(signatureEditViewController:image:)]) {
             [self.delegate signatureEditViewController:self image:image];
         }
-    } else if (CSignatureTopBarText == self.selecIndex) {
+    } else if (CSignatureTopBarImage == self.selecIndex) {
+        UIImage *image = [self.signatureDrawImageView signatureImage];
+        if (self.delegate && [self.delegate respondsToSelector:@selector(signatureEditViewController:image:)]) {
+            [self.delegate signatureEditViewController:self image:image];
+        }
+    }else if (CSignatureTopBarText == self.selecIndex) {
+        UIImage *image = [self captureScreenshotOfTextField:self.textField];
         if (self.textField.text) {
-            if(self.delegate && [self.delegate respondsToSelector:@selector(signatureEditViewController:text:)]) {
-                [self.delegate signatureEditViewController:self text:self.textField.text];
+            if(self.delegate && [self.delegate respondsToSelector:@selector(signatureEditViewController:image:)]) {
+                [self.delegate signatureEditViewController:self image:image];
             }
         }
     }
@@ -162,6 +191,41 @@
     [self.navigationController popViewControllerAnimated:YES];
 }
 
+- (void)buttonItemClicked_create:(id)sender {
+    [self createImageSignature];
+}
+
+- (void)segmentedControlValueChanged_singature:(id)sender {
+    if (self.segmentedControl.selectedSegmentIndex == 0) {
+        self.colorSelectView.hidden = NO;
+        self.signatureDrawTextView.hidden = NO;
+        self.signatureDrawImageView.hidden = YES;
+        self.textField.hidden = YES;
+        self.selecIndex = CSignatureTopBarDefault;
+        self.colorSelectView.hidden = NO;
+        self.createButton.hidden = YES;
+        self.signatureDrawTextView.selectIndex = CSignatureDrawText;
+    } else if (self.segmentedControl.selectedSegmentIndex == 1) {
+        self.colorSelectView.hidden = NO;
+        self.signatureDrawTextView.hidden = YES;
+        self.signatureDrawImageView.hidden = YES;
+        self.textField.hidden = NO;
+        self.selecIndex = CSignatureTopBarText;
+        self.colorSelectView.hidden = NO;
+        self.createButton.hidden = YES;
+    } else if (self.segmentedControl.selectedSegmentIndex == 2) {
+        self.colorSelectView.hidden = YES;
+        self.signatureDrawTextView.hidden = YES;
+        self.signatureDrawImageView.hidden = NO;
+        self.textField.hidden = YES;
+        self.selecIndex = CSignatureTopBarImage;
+        self.createButton.hidden = NO;
+        self.colorSelectView.hidden = YES;
+        self.signatureDrawImageView.selectIndex = CSignatureDrawImage;
+        [self.signatureDrawImageView setNeedsDisplay];
+    }
+}
+
 #pragma mark - Private Methods
 
 - (void)createImageSignature {
@@ -223,12 +287,34 @@
         CGImageRelease(imageRef);
     }
     
-    self.signatureDrawView.image = image;
-    [self.signatureDrawView setNeedsDisplay];
+    self.signatureDrawImageView.image = image;
+    [self.signatureDrawImageView setNeedsDisplay];
 }
 
 - (void)imagePickerControllerDidCancel:(UIImagePickerController *)picker {
     [picker dismissViewControllerAnimated:YES completion:nil];
 }
 
+#pragma mark - CPDFColorSelectViewDelegate
+
+- (void)selectColorView:(CPDFColorSelectView *)select color:(UIColor *)color {
+    self.textField.textColor = color;
+    self.signatureDrawTextView.color = color;
+}
+
+- (void)selectColorView:(CPDFColorSelectView *)select {
+    _colorPicker = [[CPDFColorPickerView alloc] initWithFrame:self.view.frame];
+    _colorPicker.delegate = self;
+    _colorPicker.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
+    _colorPicker.backgroundColor = [UIColor whiteColor];
+    [self.view addSubview:self.colorPicker];
+}
+
+#pragma mark - CPDFColorPickerViewDelegate
+
+- (void)pickerView:(CPDFColorPickerView *)colorPickerView color:(UIColor *)color {
+    self.signatureDrawTextView.color = color;
+    self.textField.textColor = color;
+}
+
 @end

+ 12 - 0
compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFSignature/CPDFSignatureViewCell.h

@@ -14,10 +14,22 @@
 
 NS_ASSUME_NONNULL_BEGIN
 
+@class CPDFSignatureViewCell;
+
+@protocol CPDFSignatureViewCellDelegate <NSObject>
+
+@optional
+
+- (void)signatureViewCell:(CPDFSignatureViewCell *)signatureViewCell;
+
+@end
+
 @interface CPDFSignatureViewCell : UITableViewCell
 
 @property (nonatomic, strong) UIImageView *signatureImageView;
 
+@property (nonatomic, weak) id<CPDFSignatureViewCellDelegate> deleteDelegate;
+
 @end
 
 NS_ASSUME_NONNULL_END

+ 20 - 0
compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFSignature/CPDFSignatureViewCell.m

@@ -12,12 +12,23 @@
 
 #import "CPDFSignatureViewCell.h"
 
+@interface CPDFSignatureViewCell ()
+
+@property (nonatomic, strong) UIButton *deleteButton;
+
+@end
+
 @implementation CPDFSignatureViewCell
 
 - (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
     if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
         self.signatureImageView = [[UIImageView alloc] init];
         [self.contentView addSubview:self.signatureImageView];
+        
+        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;
 }
@@ -29,6 +40,15 @@
     width = MIN(width, self.contentView.bounds.size.width - 80.0);
     [self.signatureImageView setFrame:CGRectMake((self.bounds.size.width - width)/2.0, 0.0, width, height)];
     self.signatureImageView.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(signatureViewCell:)]) {
+        [self.deleteDelegate signatureViewCell:self];
+    }
 }
 
 - (void)awakeFromNib {

+ 2 - 0
compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFSignature/CPDFSignatureViewController.h

@@ -23,6 +23,8 @@ NS_ASSUME_NONNULL_BEGIN
 
 - (void)signatureViewController:(CPDFSignatureViewController *)signatureViewController;
 
+- (void)signatureViewController:(CPDFSignatureViewController *)signatureViewController image:(UIImage *)image;
+
 @end
 
 @interface CPDFSignatureViewController : UIViewController

+ 70 - 21
compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFSignature/CPDFSignatureViewController.m

@@ -16,7 +16,7 @@
 #import "CSignatureManager.h"
 #import "CPDFSignatureEditViewController.h"
 
-@interface CPDFSignatureViewController () <UITableViewDelegate, UITableViewDataSource>
+@interface CPDFSignatureViewController () <UITableViewDelegate, UITableViewDataSource, CPDFSignatureViewCellDelegate>
 
 @property (nonatomic, strong) UIButton *backBtn;
 
@@ -24,7 +24,7 @@
 
 @property (nonatomic, strong) CAnnotStyle *annotStyle;
 
-@property (nonatomic, strong) UIImageView *emptyImageView;
+@property (nonatomic, strong) UILabel *emptyLabel;
 
 @property (nonatomic, strong) UIButton *createButton;
 
@@ -66,31 +66,35 @@
     self.tableView.rowHeight = 120;
     [self.view addSubview:self.tableView];
     
-    self.emptyImageView = [[UIImageView alloc] init];
-    self.emptyImageView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
-    self.emptyImageView.image = [UIImage imageNamed:@"CPDFSignatureImageEmpty" inBundle:[NSBundle bundleForClass:self.class] compatibleWithTraitCollection:nil];
-    [self.view addSubview:self.emptyImageView];
+    self.emptyLabel = [[UILabel alloc] init];
+    self.emptyLabel.text = NSLocalizedString(@"NO Signature", nil);
+    [self.view addSubview:self.emptyLabel];
     
     self.createButton = [[UIButton alloc] init];
-    self.createButton.layer.cornerRadius = 10.0;
+    self.createButton.layer.cornerRadius = 25.0;
     self.createButton.clipsToBounds = YES;
     [self.createButton setImage:[UIImage imageNamed:@"CPDFSignatureImageAdd" inBundle:[NSBundle bundleForClass:self.class] compatibleWithTraitCollection:nil] forState:UIControlStateNormal];
-    [self.createButton setTitle:NSLocalizedString(@"Add Signature", nil) forState:UIControlStateNormal];
-    self.createButton.titleLabel.adjustsFontSizeToFitWidth = YES;
-    [self.createButton setTitleColor:[UIColor blueColor] forState:UIControlStateNormal];
+    self.createButton.backgroundColor = [UIColor blueColor];
     [self.createButton addTarget:self action:@selector(buttonItemClicked_create:) forControlEvents:UIControlEventTouchUpInside];
     [self.view addSubview:self.createButton];
     
     self.view.backgroundColor = [UIColor whiteColor];
-    [self updatePreferredContentSizeWithTraitCollection:self.traitCollection];;
+    [self updatePreferredContentSizeWithTraitCollection:self.traitCollection];
+    [self createGestureRecognizer];
 }
 
 - (void)viewWillLayoutSubviews {
     [super viewWillLayoutSubviews];
     self.titleLabel.frame = CGRectMake((self.view.frame.size.width - 120)/2, 5, 120, 50);
     self.backBtn.frame = CGRectMake(self.view.frame.size.width - 60, 5, 50, 50);
-    self.createButton.frame = CGRectMake((self.view.frame.size.width - 120)/2, self.view.frame.size.height - 70, 120, 50);;
-    self.emptyImageView.frame = self.tableView.frame;
+    
+    self.emptyLabel.frame = CGRectMake((self.view.frame.size.width - 120)/2, (self.view.frame.size.height - 50)/2, 120, 50);
+    
+    if (@available(iOS 11.0, *)) {
+        self.createButton.frame = CGRectMake(self.view.frame.size.width - 70 - self.view.safeAreaInsets.right, self.view.frame.size.height - 100 - self.view.safeAreaInsets.bottom, 50, 50);
+    } else {
+        self.createButton.frame = CGRectMake(self.view.frame.size.width - 70, self.view.frame.size.height - 100, 50, 50);
+    }
 }
 
 - (void)willTransitionToTraitCollection:(UITraitCollection *)newCollection withTransitionCoordinator:(id<UIViewControllerTransitionCoordinator>)coordinator {
@@ -98,10 +102,29 @@
     [self updatePreferredContentSizeWithTraitCollection:newCollection];
 }
 
+#pragma mark - Private Methods
+
+- (void)createGestureRecognizer {
+    [self.createButton setUserInteractionEnabled:YES];
+
+    UIPanGestureRecognizer *panRecognizer = [[UIPanGestureRecognizer alloc] initWithTarget:self action:@selector(panaddBookmarkBtn:)];
+    [self.createButton addGestureRecognizer:panRecognizer];
+}
+
+- (void)panaddBookmarkBtn:(UIPanGestureRecognizer *)gestureRecognizer {
+    CGPoint point = [gestureRecognizer translationInView:self.view];
+    CGFloat newX = self.createButton.center.x + point.x;
+    CGFloat newY = self.createButton.center.y + point.y;
+    if (CGRectContainsPoint(self.view.frame, CGPointMake(newX, newY))) {
+        self.createButton.center = CGPointMake(newX, newY);
+    }
+    [gestureRecognizer setTranslation:CGPointZero inView:self.view];
+}
+
 #pragma mark - Protect Methods
 
 - (void)updatePreferredContentSizeWithTraitCollection:(UITraitCollection *)traitCollection {
-    self.preferredContentSize = CGSizeMake(self.view.bounds.size.width, traitCollection.verticalSizeClass == UIUserInterfaceSizeClassCompact ? 270 : 420);
+    self.preferredContentSize = CGSizeMake(self.view.bounds.size.width, traitCollection.verticalSizeClass == UIUserInterfaceSizeClassCompact ? 350 : 660);
 }
 
 #pragma mark - Action
@@ -121,10 +144,10 @@
 
 - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
     if ([CSignatureManager sharedManager].signatures.count <= 0) {
-        self.emptyImageView.hidden = NO;
+        self.emptyLabel.hidden = NO;
         self.tableView.hidden = YES;
     } else {
-        self.emptyImageView.hidden = YES;
+        self.emptyLabel.hidden = YES;
         self.tableView.hidden = NO;
     }
     return [CSignatureManager sharedManager].signatures.count;
@@ -135,13 +158,39 @@
     if (cell == nil) {
         cell = [[CPDFSignatureViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:@"cell"];
     }
-    if ([[UIImage imageWithContentsOfFile:[CSignatureManager sharedManager].signatures[indexPath.row]] isKindOfClass:[UIImage class]]) {
-        cell.signatureImageView.image = [UIImage imageWithContentsOfFile:[CSignatureManager sharedManager].signatures[indexPath.row]];
-    } else if ([[CSignatureManager sharedManager].signatures[indexPath.row] isKindOfClass:[NSString class]]) {
-        cell.textLabel.text = [CSignatureManager sharedManager].signatures[indexPath.row];
-    }
+    cell.signatureImageView.image = [UIImage imageWithContentsOfFile:[CSignatureManager sharedManager].signatures[indexPath.row]];
+
+    cell.deleteDelegate = self;
     
     return cell;
 }
 
+#pragma mark - UITableViewDelegate
+
+- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
+    if (!tableView.isEditing) {
+        [self.tableView deselectRowAtIndexPath:indexPath animated:YES];
+        [self dismissViewControllerAnimated:YES completion:^{
+            if (self.delegate && [self.delegate respondsToSelector:@selector(signatureViewController:image:)]) {
+                UIImage *image = [UIImage imageWithContentsOfFile:[CSignatureManager sharedManager].signatures[indexPath.row]];
+                [self.delegate signatureViewController:self image:image];
+            }
+        }];
+    }
+}
+
+#pragma mark - CPDFSignatureViewCellDelegate
+
+- (void)signatureViewCell:(CPDFSignatureViewCell *)signatureViewCell {
+    NSMutableIndexSet *indexSet = [NSMutableIndexSet indexSet];
+    for (NSIndexPath *indexPath in self.tableView.indexPathsForSelectedRows) {
+        [indexSet addIndex:indexPath.row];
+    }
+    [[CSignatureManager sharedManager] removeSignaturesAtIndexes:indexSet];
+    if ([CSignatureManager sharedManager].signatures.count < 1) {
+        [self setEditing:NO animated:YES];
+    }
+    [self.tableView reloadData];
+}
+
 @end

+ 11 - 0
compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFSignature/CSignatureDrawView.h

@@ -14,14 +14,25 @@
 
 NS_ASSUME_NONNULL_BEGIN
 
+typedef NS_ENUM(NSInteger, CSignatureDrawSelectedIndex) {
+    CSignatureDrawText = 0,
+    CSignatureDrawImage
+};
+
 @interface CSignatureDrawView : UIView
 
 @property (nonatomic, strong) UIColor *color;
+
 @property (nonatomic, assign) CGFloat lineWidth;
+
 @property (nullable, nonatomic, strong) UIImage *image;
 
+@property (nonatomic, assign) CSignatureDrawSelectedIndex selectIndex;
+
 - (UIImage *)signatureImage;
 
+- (void)signatureClear;
+
 @end
 
 NS_ASSUME_NONNULL_END

+ 22 - 10
compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFSignature/CSignatureDrawView.m

@@ -50,23 +50,27 @@ static NSInteger _index;
 
 - (void)layoutSubviews {
     [super layoutSubviews];
-    [self setNeedsDisplay];
+    [self setNeedsDisplayInRect:self.bounds];
     self.clearButton.frame = CGRectMake(self.frame.size.width - 80, self.frame.size.height - 60, 70, 40);
 }
 
 - (void)drawRect:(CGRect)rect {
     [super drawRect:rect];
     
-    if (self.image) {
-        CGRect imageFrame = [self imageFrameInRect:rect];
-        [self.image drawInRect:imageFrame];
+    if (CSignatureDrawText == self.selectIndex) {
+        [self.color set];
+        [self.bezierPath setLineWidth:self.lineWidth];
+        [self.bezierPath setLineCapStyle:kCGLineCapRound];
+        [self.bezierPath setLineJoinStyle:kCGLineJoinRound];
+        [self.bezierPath stroke];
+    } else if (CSignatureDrawImage) {
+        if (self.image) {
+            CGRect imageFrame = [self imageFrameInRect:rect];
+            [self.image drawInRect:imageFrame];
+        }
+        self.clearButton.hidden = YES;
     }
-    
-    [self.color set];
-    [self.bezierPath setLineWidth:self.lineWidth];
-    [self.bezierPath setLineCapStyle:kCGLineCapRound];
-    [self.bezierPath setLineJoinStyle:kCGLineJoinRound];
-    [self.bezierPath stroke];
+        
 }
 
 #pragma mark - Draw Methods
@@ -138,6 +142,14 @@ static NSInteger _index;
     return image;
 }
 
+#pragma mark - Public Methods
+
+- (void)signatureClear {
+    self.image = nil;
+    [self.bezierPath removeAllPoints];
+    [self setNeedsDisplay];
+}
+
 #pragma mark - Action
 
 - (void)buttonItemClicked_clear:(UIButton *)button {

+ 1 - 7
compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFSignature/CSignatureTopBar.h

@@ -14,19 +14,13 @@
 
 NS_ASSUME_NONNULL_BEGIN
 
-typedef NS_ENUM(NSInteger, CSignatureTopBarSelectedIndex) {
-    CSignatureTopBarDefault = 0,
-    CSignatureTopBarText,
-    CSignatureTopBarImage
-};
-
 @class CSignatureTopBar;
 
 @protocol CSignatureTopBarDelegate <NSObject>
 
 @optional
 
-- (void)signatureTopBar:(CSignatureTopBar *)signatureTopBar selectIndex:(CSignatureTopBarSelectedIndex)selectIndex;
+//- (void)signatureTopBar:(CSignatureTopBar *)signatureTopBar selectIndex:(CSignatureTopBarSelectedIndex)selectIndex;
 
 @end
 

+ 1 - 1
compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFSignature/CSignatureTopBar.m

@@ -52,7 +52,7 @@
 
 - (void)buttonItemClicked_swith:(UIButton *)button {
     if (self.delegate && [self.delegate respondsToSelector:@selector(signatureTopBar:selectIndex:)]) {
-        [self.delegate signatureTopBar:self selectIndex:button.tag];
+//        [self.delegate signatureTopBar:self selectIndex:button.tag];
     }
 }
 

+ 1 - 2
compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFSignature/Image.xcassets/CPDFSignatureImageAdd.imageset/Contents.json

@@ -1,12 +1,11 @@
 {
   "images" : [
     {
-      "filename" : "signature_icon_add.png",
+      "filename" : "add.pdf",
       "idiom" : "universal",
       "scale" : "1x"
     },
     {
-      "filename" : "signature_icon_add@2x.png",
       "idiom" : "universal",
       "scale" : "2x"
     },

+ 79 - 0
compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFSignature/Image.xcassets/CPDFSignatureImageAdd.imageset/add.pdf

@@ -0,0 +1,79 @@
+%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 2.000000 2.000000 cm
+1.000000 1.000000 1.000000 scn
+8.750000 9.000000 m
+8.750000 16.000000 l
+7.250000 16.000000 l
+7.250000 9.000000 l
+0.000000 9.000000 l
+0.000000 7.500000 l
+7.250000 7.500000 l
+7.250000 0.000000 l
+8.750000 0.000000 l
+8.750000 7.500000 l
+16.000000 7.500000 l
+16.000000 9.000000 l
+8.750000 9.000000 l
+h
+f*
+n
+Q
+
+endstream
+endobj
+
+3 0 obj
+  392
+endobj
+
+4 0 obj
+  << /Annots []
+     /Type /Page
+     /MediaBox [ 0.000000 0.000000 20.000000 20.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
+0000000482 00000 n
+0000000504 00000 n
+0000000677 00000 n
+0000000751 00000 n
+trailer
+<< /ID [ (some) (id) ]
+   /Root 6 0 R
+   /Size 7
+>>
+startxref
+810
+%%EOF

BIN
compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFSignature/Image.xcassets/CPDFSignatureImageAdd.imageset/signature_icon_add.png


BIN
compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFSignature/Image.xcassets/CPDFSignatureImageAdd.imageset/signature_icon_add@2x.png


+ 21 - 0
compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFSignature/Image.xcassets/CPDFSignatureImageDelete.imageset/Contents.json

@@ -0,0 +1,21 @@
+{
+  "images" : [
+    {
+      "filename" : "delete.pdf",
+      "idiom" : "universal",
+      "scale" : "1x"
+    },
+    {
+      "idiom" : "universal",
+      "scale" : "2x"
+    },
+    {
+      "idiom" : "universal",
+      "scale" : "3x"
+    }
+  ],
+  "info" : {
+    "author" : "xcode",
+    "version" : 1
+  }
+}

+ 103 - 0
compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFSignature/Image.xcassets/CPDFSignatureImageDelete.imageset/delete.pdf

@@ -0,0 +1,103 @@
+%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 1.000000 1.500000 cm
+1.000000 0.000000 0.000000 scn
+13.000000 17.000000 m
+13.000000 14.000000 l
+18.000000 14.000000 l
+18.000000 13.000000 l
+15.500000 13.000000 l
+15.500000 0.000000 l
+2.500000 0.000000 l
+2.500000 13.000000 l
+0.000000 13.000000 l
+0.000000 14.000000 l
+5.000000 14.000000 l
+5.000000 17.000000 l
+13.000000 17.000000 l
+h
+3.500000 13.000000 m
+3.500000 1.000000 l
+14.500000 1.000000 l
+14.500000 13.000000 l
+3.500000 13.000000 l
+h
+12.000000 16.000000 m
+12.000000 14.000000 l
+6.000000 14.000000 l
+6.000000 16.000000 l
+12.000000 16.000000 l
+h
+7.500000 10.500000 m
+7.500000 3.500000 l
+6.500000 3.500000 l
+6.500000 10.500000 l
+7.500000 10.500000 l
+h
+11.500000 3.500000 m
+11.500000 10.500000 l
+10.500000 10.500000 l
+10.500000 3.500000 l
+11.500000 3.500000 l
+h
+f*
+n
+Q
+
+endstream
+endobj
+
+3 0 obj
+  837
+endobj
+
+4 0 obj
+  << /Annots []
+     /Type /Page
+     /MediaBox [ 0.000000 0.000000 20.000000 20.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
+0000000927 00000 n
+0000000949 00000 n
+0000001122 00000 n
+0000001196 00000 n
+trailer
+<< /ID [ (some) (id) ]
+   /Root 6 0 R
+   /Size 7
+>>
+startxref
+1255
+%%EOF

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

@@ -0,0 +1,41 @@
+//
+//  CPDFStampViewController.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 NSString* const PDFAnnotationStampKey NS_STRING_ENUM;
+
+extern PDFAnnotationStampKey PDFAnnotationStampKeyType;        // NSIntger
+extern PDFAnnotationStampKey PDFAnnotationStampKeyImagePath;   // NSString
+extern PDFAnnotationStampKey PDFAnnotationStampKeyText;        // NSString
+extern PDFAnnotationStampKey PDFAnnotationStampKeyShowDate;    // BOOL
+extern PDFAnnotationStampKey PDFAnnotationStampKeyShowTime;    // BOOL
+extern PDFAnnotationStampKey PDFAnnotationStampKeyStyle;       // NSIntger
+extern PDFAnnotationStampKey PDFAnnotationStampKeyShape;       // NSIntger
+
+@class CPDFStampViewController;
+
+@protocol CPDFStampViewControllerDelegate <NSObject>
+
+@optional
+
+- (void)stampViewController:(CPDFStampViewController *)stampViewController selectedInde:(NSInteger)selectedIndex stamp:(NSDictionary *)stamp;
+
+@end
+
+@interface CPDFStampViewController : UIViewController
+
+@end
+
+NS_ASSUME_NONNULL_END

+ 268 - 0
compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFStamp/CPDFStampViewController.m

@@ -0,0 +1,268 @@
+//
+//  CPDFStampViewController.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 "CPDFStampViewController.h"
+#import "CStampFileManger.h"
+#import "CStampCollectionViewCell.h"
+#import "CPDFColorUtils.h"
+#import "CStampButton.h"
+
+#import <ComPDFKit/ComPDFKit.h>
+
+PDFAnnotationStampKey const PDFAnnotationStampKeyType = @"PDFAnnotationStampKeyType";
+PDFAnnotationStampKey const PDFAnnotationStampKeyImagePath = @"PDFAnnotationStampKeyImagePath";
+PDFAnnotationStampKey const PDFAnnotationStampKeyText = @"PDFAnnotationStampKeyText";
+PDFAnnotationStampKey const PDFAnnotationStampKeyShowDate = @"PDFAnnotationStampKeyShowDate";
+PDFAnnotationStampKey const PDFAnnotationStampKeyShowTime = @"PDFAnnotationStampKeyShowTime";
+PDFAnnotationStampKey const PDFAnnotationStampKeyStyle = @"PDFAnnotationStampKeyStyle";
+PDFAnnotationStampKey const PDFAnnotationStampKeyShape = @"PDFAnnotationStampKeyShape";
+
+@interface CPDFStampViewController () <UICollectionViewDelegate, UICollectionViewDataSource>
+
+@property (nonatomic, strong) UICollectionView *collectView;
+
+@property (nonatomic, strong) UISegmentedControl *segmentedControl;
+
+@property (nonatomic, strong) NSArray *standardArray;
+
+@property (nonatomic, strong) NSArray *customTextArray;
+
+@property (nonatomic, strong) NSArray *customImageArray;
+
+@property (nonatomic, strong) NSMutableDictionary *imgDicCache;
+
+@property (nonatomic, strong) UIButton *backBtn;
+
+@property (nonatomic, strong) UILabel *titleLabel;
+
+@property (nonatomic, strong) UIButton *createButton;
+
+@property (nonatomic, strong) UIView *standardView;
+
+@property (nonatomic, strong) UIView *customizeView;
+
+@property (nonatomic, strong) CStampFileManger *stampFileManager;
+
+@property (nonatomic, strong) CStampButton *textButton;
+
+@property (nonatomic, strong) CStampButton *imageButton;
+
+@end
+
+@implementation CPDFStampViewController
+
+#pragma mark - ViewController Methods
+
+- (void)viewDidLoad {
+    [super viewDidLoad];
+    // Do any additional setup after loading the view.
+    self.view.backgroundColor = [CPDFColorUtils CPDFViewControllerBackgroundColor];
+    
+    self.titleLabel = [[UILabel alloc] init];
+    self.titleLabel.autoresizingMask = UIViewAutoresizingFlexibleRightMargin;
+    self.titleLabel.text = NSLocalizedString(@"Stamp", nil);
+    self.titleLabel.font = [UIFont systemFontOfSize:20];
+    self.titleLabel.adjustsFontSizeToFitWidth = YES;
+    [self.view addSubview:self.titleLabel];
+    
+    self.backBtn = [[UIButton alloc] init];
+    self.backBtn.autoresizingMask = UIViewAutoresizingFlexibleLeftMargin;
+    [self.backBtn setImage:[UIImage imageNamed:@"CPDFAnnotationBaseImageBack" inBundle:[NSBundle bundleForClass:self.class] compatibleWithTraitCollection:nil] forState:UIControlStateNormal];
+    [self.backBtn addTarget:self action:@selector(buttonItemClicked_back:) forControlEvents:UIControlEventTouchUpInside];
+    [self.view addSubview:self.backBtn];
+    
+    NSArray *segmmentArray = [NSArray arrayWithObjects:NSLocalizedString(@"Standard", nil), NSLocalizedString(@"Customize", nil), nil];
+    self.segmentedControl = [[UISegmentedControl alloc] initWithItems:segmmentArray];
+    self.segmentedControl.selectedSegmentIndex = 0;
+    self.segmentedControl.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
+    [self.segmentedControl addTarget:self action:@selector(segmentedControlValueChanged_singature:) forControlEvents:UIControlEventValueChanged];
+    [self.view addSubview:self.segmentedControl];
+    
+    // StandardView
+    [self createStandardView];
+    
+    // CustomizeView
+    [self createCustomizeView];
+    
+    // Data
+    NSMutableArray *array = [NSMutableArray array];
+    for (int i=1; i<13; i++) {
+        NSString *tPicName = nil;
+        if (i<10) {
+            tPicName = [NSString stringWithFormat:@"CPDFStampImage-0%d.png",i];
+        } else {
+            tPicName = [NSString stringWithFormat:@"CPDFStampImage-%d.png",i];
+        }
+        [array addObject:tPicName];
+    }
+    [array addObjectsFromArray:@[@"CPDFStampImage-13", @"CPDFStampImage-14", @"CPDFStampImage-15", @"CPDFStampImage-16", @"CPDFStampImage-18", @"CPDFStampImage-20", @"CPDFStampImage_chick", @"CPDFStampImage_cross", @"CPDFStampImage_circle"]];
+    self.standardArray = array;
+    self.imgDicCache = [NSMutableDictionary dictionary];
+    
+    self.stampFileManager = [[CStampFileManger alloc] init];
+    [self.stampFileManager readStampDataFromFile];
+    self.customTextArray = [self.stampFileManager getTextStampData];
+    self.customImageArray = [self.stampFileManager getImageStampData];
+    
+    [self createGestureRecognizer];
+    [self updatePreferredContentSizeWithTraitCollection:self.traitCollection];
+}
+
+- (void)viewWillLayoutSubviews {
+    [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);
+    } 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);
+    }
+}
+
+- (void)viewWillAppear:(BOOL)animated {
+    [super viewWillAppear:animated];
+    
+    [self.collectView reloadData];
+}
+
+- (void)willTransitionToTraitCollection:(UITraitCollection *)newCollection withTransitionCoordinator:(id<UIViewControllerTransitionCoordinator>)coordinator {
+    [super willTransitionToTraitCollection:newCollection withTransitionCoordinator:coordinator];
+    [self updatePreferredContentSizeWithTraitCollection:newCollection];
+}
+
+#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.autoresizingMask = UIViewAutoresizingFlexibleWidth|UIViewAutoresizingFlexibleHeight;
+    [self.view addSubview:self.standardView];
+    
+    UICollectionViewFlowLayout *layout = [[UICollectionViewFlowLayout alloc] init];
+    layout.scrollDirection = UICollectionViewScrollDirectionVertical;
+    layout.minimumInteritemSpacing = 10;
+    layout.minimumLineSpacing = 10;
+    layout.itemSize = CGSizeMake(170,80);
+    layout.sectionInset = UIEdgeInsetsMake(5, 20, 5, 20);
+    
+    self.collectView = [[UICollectionView alloc] initWithFrame:self.view.bounds collectionViewLayout:layout];
+    self.collectView.autoresizingMask = UIViewAutoresizingFlexibleWidth|UIViewAutoresizingFlexibleHeight;
+    self.collectView.delegate = self;
+    self.collectView.dataSource = self;
+    self.collectView.backgroundColor = [UIColor clearColor];
+    [self.collectView registerClass:[StampCollectionHeaderView class]
+     forSupplementaryViewOfKind:UICollectionElementKindSectionHeader
+            withReuseIdentifier:@"header"];
+    [self.collectView registerClass:[StampCollectionHeaderView1 class]
+     forSupplementaryViewOfKind:UICollectionElementKindSectionHeader
+            withReuseIdentifier:@"header1"];
+    [self.collectView registerClass:[CStampCollectionViewCell class]
+     forCellWithReuseIdentifier:@"TStampViewCell"];
+    
+    if (@available(iOS 11.0, *)) {
+        _collectView.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentAlways;
+    }
+    [self.standardView addSubview:self.collectView];
+}
+
+- (void)createCustomizeView {
+    self.customizeView = [[UIView alloc] initWithFrame:CGRectMake(0, 100, self.view.bounds.size.width, self.view.bounds.size.height)];
+    self.customizeView.autoresizingMask = UIViewAutoresizingFlexibleWidth|UIViewAutoresizingFlexibleHeight;
+    [self.view addSubview:self.customizeView];
+    self.customizeView.hidden = YES;
+    
+    self.createButton = [[UIButton alloc] init];
+    self.createButton.layer.cornerRadius = 25.0;
+    self.createButton.clipsToBounds = YES;
+    [self.createButton setImage:[UIImage imageNamed:@"CPDFSignatureImageAdd" inBundle:[NSBundle bundleForClass:self.class] compatibleWithTraitCollection:nil] forState:UIControlStateNormal];
+    self.createButton.backgroundColor = [UIColor blueColor];
+    [self.createButton addTarget:self action:@selector(buttonItemClicked_create:) forControlEvents:UIControlEventTouchUpInside];
+    [self.customizeView addSubview:self.createButton];
+    
+    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.stampBtn addTarget:self action:@selector(buttonItemClicked_text:) forControlEvents:UIControlEventTouchUpInside];
+    [self.customizeView addSubview:self.textButton];
+}
+
+- (void)createGestureRecognizer {
+    [self.createButton setUserInteractionEnabled:YES];
+
+    UIPanGestureRecognizer *panRecognizer = [[UIPanGestureRecognizer alloc] initWithTarget:self action:@selector(panaddBookmarkBtn:)];
+    [self.createButton addGestureRecognizer:panRecognizer];
+}
+
+- (void)panaddBookmarkBtn:(UIPanGestureRecognizer *)gestureRecognizer {
+    CGPoint point = [gestureRecognizer translationInView:self.view];
+    CGFloat newX = self.createButton.center.x + point.x;
+    CGFloat newY = self.createButton.center.y + point.y;
+    if (CGRectContainsPoint(self.view.frame, CGPointMake(newX, newY))) {
+        self.createButton.center = CGPointMake(newX, newY);
+    }
+    [gestureRecognizer setTranslation:CGPointZero inView:self.view];
+}
+
+#pragma mark - Protect Methods
+
+- (void)updatePreferredContentSizeWithTraitCollection:(UITraitCollection *)traitCollection {
+    self.preferredContentSize = CGSizeMake(self.view.bounds.size.width, traitCollection.verticalSizeClass == UIUserInterfaceSizeClassCompact ? 370 : 800);
+}
+
+#pragma mark - Action
+
+- (void)buttonItemClicked_back:(id)sender {
+    [self dismissViewControllerAnimated:YES completion:nil];
+}
+
+- (void)buttonItemClicked_create:(id)sender {
+    
+}
+
+- (void)segmentedControlValueChanged_singature:(id)sender {
+    if (self.segmentedControl.selectedSegmentIndex == 0) {
+        self.standardView.hidden = NO;
+        self.customizeView.hidden = YES;
+    } else {
+        self.standardView.hidden = YES;
+        self.customizeView.hidden = NO;
+    }
+}
+
+- (void)buttonItemClicked_text:(id)sender {
+    
+}
+
+- (void)buttonItemClicked_image:(id)sender {
+    
+}
+
+#pragma mark - UICollectionViewDataSource
+
+- (NSInteger)numberOfSectionsInCollectionView:(UICollectionView *)collectionView {
+    return 1;
+}
+
+- (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section {
+    return self.standardArray.count;
+}
+
+- (__kindof UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath {
+    CStampCollectionViewCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"TStampViewCell" forIndexPath:indexPath];
+    cell.editing = NO;
+    cell.stampImage.image = [UIImage imageNamed:self.standardArray[indexPath.item] inBundle:[NSBundle bundleForClass:[self class]] compatibleWithTraitCollection:nil];
+    return cell;
+}
+
+@end

+ 25 - 0
compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFStamp/CStampButton.h

@@ -0,0 +1,25 @@
+//
+//  CStampButton.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 CStampButton : UIView
+
+@property (nonatomic, strong) UIButton *stampBtn;
+
+@property (nonatomic, strong) UILabel *titleLabel;
+
+@end
+
+NS_ASSUME_NONNULL_END

+ 40 - 0
compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFStamp/CStampButton.m

@@ -0,0 +1,40 @@
+//
+//  CStampButton.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 "CStampButton.h"
+
+@implementation CStampButton
+
+- (instancetype)initWithFrame:(CGRect)frame {
+    if (self = [super initWithFrame:frame]) {
+        self.stampBtn = [[UIButton alloc] init];
+        self.stampBtn.layer.cornerRadius = 20;
+        self.stampBtn.layer.masksToBounds = YES;
+        [self addSubview:self.stampBtn];
+        
+        self.titleLabel = [[UILabel alloc] init];
+        self.titleLabel.textColor = [UIColor whiteColor];
+        self.titleLabel.backgroundColor = [UIColor clearColor];
+        [self addSubview:self.titleLabel];
+        
+        self.backgroundColor = [UIColor clearColor];
+    }
+    return self;
+}
+
+- (void)layoutSubviews {
+    [super layoutSubviews];
+    self.stampBtn.frame = CGRectMake(self.bounds.size.width - 40, 0, 40, self.bounds.size.height);
+    self.titleLabel.frame = CGRectMake(0, 0, 120, self.bounds.size.height);
+}
+
+@end

+ 58 - 0
compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFStamp/CStampCollectionViewCell.h

@@ -0,0 +1,58 @@
+//
+//  CStampCollectionViewCell.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
+
+#pragma mark - StampCollectionHeaderView
+
+@interface StampCollectionHeaderView : UICollectionReusableView
+
+@property (nonatomic,retain) UILabel *textLabel;
+
+@end
+
+#pragma mark - StampCollectionHeaderView1
+
+@class StampCollectionHeaderView1;
+
+@protocol StampHeaderViewDelegate <NSObject>
+
+@optional
+- (void)addTextWithHeaderView:(StampCollectionHeaderView1 *)headerView;
+
+- (void)addImageWithHeaderView:(StampCollectionHeaderView1 *)headerView;
+
+@end
+
+#pragma mark - StampCollectionHeaderView1
+
+@interface StampCollectionHeaderView1 : UICollectionReusableView
+
+@property (nonatomic,retain)UILabel *textLabel;
+
+@property (nonatomic,assign) id<StampHeaderViewDelegate> delegate;
+
+@end
+
+#pragma mark - StampCollectionViewCell
+
+@interface CStampCollectionViewCell : UICollectionViewCell
+
+@property (nonatomic, strong) UIImageView *stampImage;
+
+@property (nonatomic, assign) BOOL editing;
+
+@end
+
+NS_ASSUME_NONNULL_END

+ 143 - 0
compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFStamp/CStampCollectionViewCell.m

@@ -0,0 +1,143 @@
+//
+//  CStampCollectionViewCell.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 "CStampCollectionViewCell.h"
+
+#pragma mark - StampCollectionViewCell
+
+@interface CStampCollectionViewCell ()
+
+@end
+
+@implementation CStampCollectionViewCell
+
+- (instancetype)initWithFrame:(CGRect)frame {
+    if (self = [super initWithFrame:frame]) {
+        self.stampImage = [[UIImageView alloc] init];
+        self.stampImage.backgroundColor = [UIColor clearColor];
+        self.stampImage.contentMode = UIViewContentModeScaleAspectFit;
+        [self.contentView addSubview:self.stampImage];
+        
+        self.contentView.layer.borderWidth = 0.5;
+        self.contentView.layer.borderColor = [UIColor lightGrayColor].CGColor;
+    }
+    return self;
+}
+
+- (void)layoutSubviews {
+    [super layoutSubviews];
+    self.stampImage.frame = CGRectMake(10, (self.contentView.bounds.size.height - 50)/2,
+                                   self.contentView.bounds.size.width - 20, 50);
+}
+
+@end
+
+#pragma mark - StampCollectionHeaderView
+
+@implementation StampCollectionHeaderView
+
+- (instancetype)initWithFrame:(CGRect)frame {
+    if (self = [super initWithFrame:frame]) {
+        self.backgroundColor = [UIColor colorWithRed:248.0/255.0 green:248.0/255.0  blue:248.0/255.0  alpha:1.0];
+
+        _textLabel = [[UILabel alloc] init];
+        _textLabel.textColor = [UIColor colorWithRed:36.0/255.0 green:36.0/255.0 blue:36.0/255.0 alpha:1.0];
+        _textLabel.font = [UIFont systemFontOfSize:14.0];
+        [self addSubview:_textLabel];
+    }
+    return self;
+}
+
+- (void)layoutSubviews {
+    [super layoutSubviews];
+    _textLabel.frame = CGRectMake(10, 0, self.bounds.size.width-20, 20);
+}
+
+@end
+
+#pragma mark - StampCollectionHeaderView1
+
+@interface StampCollectionHeaderView1()
+
+@property (nonatomic,retain) UIView * headerView;
+
+@property (nonatomic,retain) UIButton * textButton;
+
+@property (nonatomic,retain) UIButton * imageButton;
+
+@end
+
+@implementation StampCollectionHeaderView1
+
+- (instancetype)initWithFrame:(CGRect)frame {
+    if (self = [super initWithFrame:frame]) {
+        _headerView = [[UIView alloc] init];
+        _headerView.backgroundColor = [UIColor clearColor];
+        [self addSubview:_headerView];
+        
+        self.textButton = [UIButton buttonWithType:UIButtonTypeSystem];
+        [_textButton setTitle:NSLocalizedString(@"New Text Stamp", nil) forState:UIControlStateNormal];
+        [_textButton setTitleColor:[UIColor colorWithRed:36.0/255.0 green:36.0/255.0 blue:36.0/255.0 alpha:1.0] forState:UIControlStateNormal];
+        [_textButton addTarget:self action:@selector(buttonItemClicked_AddText:) forControlEvents:UIControlEventTouchUpInside];
+        _textButton.layer.borderWidth = 1;
+        _textButton.layer.cornerRadius = 5;
+        _textButton.titleLabel.font = [UIFont systemFontOfSize:16.0];
+        _textButton.titleLabel.adjustsFontSizeToFitWidth = YES;
+        _textButton.layer.borderColor = [UIColor colorWithRed:17.0/255.0 green:140.0/255.0 blue:1.0 alpha:1.0].CGColor;
+        [_headerView addSubview:_textButton];
+        
+        self.imageButton = [UIButton buttonWithType:UIButtonTypeSystem];
+        [_imageButton setTitle:NSLocalizedString(@"New Image Stamp", nil) forState:UIControlStateNormal];
+        [_imageButton setTitleColor:[UIColor colorWithRed:36.0/255.0 green:36.0/255.0 blue:36.0/255.0 alpha:1.0] forState:UIControlStateNormal];
+        _imageButton.titleLabel.font = [UIFont systemFontOfSize:16.0];
+        _imageButton.titleLabel.adjustsFontSizeToFitWidth = YES;
+        [_imageButton addTarget:self action:@selector(buttonItemClicked_AddImage:) forControlEvents:UIControlEventTouchUpInside];
+        _imageButton.layer.borderWidth = 1;
+        _imageButton.layer.cornerRadius = 5;
+        _imageButton.layer.borderColor = [UIColor colorWithRed:17.0/255.0 green:140.0/255.0 blue:1.0 alpha:1.0].CGColor;
+        [_headerView addSubview:_imageButton];
+        
+        self.backgroundColor = [UIColor colorWithRed:248.0/255.0 green:248.0/255.0  blue:248.0/255.0  alpha:1.0];
+        
+        _textLabel = [[UILabel alloc] init];
+        _textLabel.textColor = [UIColor colorWithRed:36.0/255.0 green:36.0/255.0 blue:36.0/255.0 alpha:1.0];
+        _textLabel.font = [UIFont systemFontOfSize:14.0];
+        [self addSubview:_textLabel];
+    
+    }
+    return self;
+}
+
+- (void)layoutSubviews {
+    [super layoutSubviews];
+    _headerView.frame = CGRectMake(0, 0, self.bounds.size.width, 80);
+    _textButton.frame = CGRectMake(10, CGRectGetMinY(_headerView.frame)+10, (self.bounds.size.width-40)/2, 60);
+    _imageButton.frame = CGRectMake(30 + (self.bounds.size.width-40)/2, CGRectGetMinY(_headerView.frame)+10, (self.bounds.size.width-40)/2, 60);
+    _textLabel.frame = CGRectMake(10, CGRectGetMinY(_headerView.frame)+80, self.bounds.size.width-20, 20);
+}
+
+#pragma mark - Button Event Action
+
+- (void)buttonItemClicked_AddImage:(id)sender {
+    if ([self.delegate respondsToSelector:@selector(addImageWithHeaderView:)]) {
+        [self.delegate addImageWithHeaderView:self];
+    }
+}
+
+- (void)buttonItemClicked_AddText:(id)sender {
+    if ([self.delegate respondsToSelector:@selector(addTextWithHeaderView:)]) {
+        [self.delegate addTextWithHeaderView:self];
+    }
+
+}
+
+@end

+ 50 - 0
compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFStamp/CStampFileManger.h

@@ -0,0 +1,50 @@
+//
+//  CStampFileManger.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
+
+#define kPDFStampDataFolder [NSHomeDirectory() stringByAppendingPathComponent:@"Library/PDFKitResources/Stamp"]
+#define kPDFStampTextList   [NSHomeDirectory() stringByAppendingPathComponent:@"Library/PDFKitResources/Stamp/stamp_text.plist"]
+#define kPDFStampImageList  [NSHomeDirectory() stringByAppendingPathComponent:@"Library/PDFKitResources/Stamp/stamp_image.plist"]
+
+typedef enum : NSUInteger {
+    PDFStampCustomType_Text,
+    PDFStampCustomType_Image,
+} PDFStampCustomType;
+
+@interface CStampFileManger : NSObject
+
+@property (nonatomic, strong) NSMutableArray *stampTextList;
+
+@property (nonatomic, strong) NSMutableArray *stampImageList;
+
+@property (nonatomic, strong) NSMutableArray *deleteList;
+
+- (void)readStampDataFromFile;
+
+- (NSArray *)getTextStampData;
+
+- (NSArray *)getImageStampData;
+
+- (BOOL)saveStampDataToFile:(PDFStampCustomType)stampType;
+
+- (BOOL)insertStampItem:(NSDictionary *)stampItem type:(PDFStampCustomType)stampType;
+
+- (BOOL)removeStampItem:(NSInteger)index type:(PDFStampCustomType)stampType;
+
+- (NSString *)saveStampWithImage:(UIImage *)image;
+
+@end
+
+NS_ASSUME_NONNULL_END

+ 307 - 0
compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFStamp/CStampFileManger.m

@@ -0,0 +1,307 @@
+//
+//  CStampFileManger.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 "CStampFileManger.h"
+
+@implementation CStampFileManger
+
+#pragma mark - Init Method
+- (id)init
+{
+    self = [super init];
+    if (self) {
+        _deleteList = [[NSMutableArray alloc] init];
+    }
+    
+    return self;
+}
+
+- (NSString *)getDateTime
+{
+    NSTimeZone* timename = [NSTimeZone systemTimeZone];
+    NSDateFormatter *outputFormatter = [[NSDateFormatter alloc] init ];
+    [outputFormatter setTimeZone:timename ];
+    
+    NSString *tDate = nil;
+    
+    [outputFormatter setDateFormat:@"YYYYMMddHHmmss"];
+    tDate = [outputFormatter stringFromDate:[NSDate date]];
+    
+    return tDate;
+}
+
+#pragma mark - File Manager
+
+- (void)readStampDataFromFile
+{
+    [self readCustomStamp_TextStamp];
+    [self readCustomStamp_ImageStamp];
+}
+
+- (void)readCustomStamp_TextStamp
+{
+    NSFileManager *tManager = [NSFileManager defaultManager];
+    if (![tManager fileExistsAtPath:kPDFStampTextList])
+    {
+        _stampTextList = [[NSMutableArray alloc] init];
+    }
+    else
+    {
+        if (_stampTextList)
+        {
+            _stampTextList = nil;
+        }
+        
+        _stampTextList = [NSMutableArray arrayWithContentsOfFile:kPDFStampTextList];
+        if (_stampTextList == nil) {
+            _stampTextList = [[NSMutableArray alloc] init];
+        }
+    }
+}
+
+- (void)readCustomStamp_ImageStamp
+{
+    NSFileManager *tManager = [NSFileManager defaultManager];
+    if (![tManager fileExistsAtPath:kPDFStampImageList])
+    {
+        _stampImageList = [[NSMutableArray alloc] init];
+    }
+    else
+    {
+        if (_stampImageList)
+        {
+            _stampImageList = nil;
+        }
+        
+        _stampImageList = [NSMutableArray arrayWithContentsOfFile:kPDFStampImageList];
+        if (_stampImageList == nil) {
+            _stampImageList = [[NSMutableArray alloc] init];
+        }
+    }
+}
+
+- (NSArray *)getTextStampData
+{
+    return _stampTextList;
+}
+
+- (NSArray *)getImageStampData
+{
+    return _stampImageList;
+}
+
+- (NSString *)saveStampWithImage:(UIImage *)image
+{
+    NSFileManager *tManager = [NSFileManager defaultManager];
+    NSData *imageData = UIImagePNGRepresentation(image);
+    
+    if (imageData == nil || [imageData length] <= 0)
+        return nil;
+    
+    NSString *tName = [self getDateTime];
+    NSString *tPath = [kPDFStampDataFolder stringByAppendingFormat:@"/%@.png",tName];
+    
+    if ([imageData writeToFile:tPath atomically:NO]) {
+        return tPath;
+    }
+    else
+    {
+        NSString *tPath_dic = kPDFStampDataFolder;
+        BOOL tIsDirectory = NO;
+        while (1)
+        {
+            if ([tManager fileExistsAtPath:tPath_dic isDirectory:&tIsDirectory]) {
+                if (tIsDirectory)
+                    break;
+            }
+            else
+            {
+                [tManager createDirectoryAtPath:tPath_dic withIntermediateDirectories:NO attributes:nil error:nil];
+            }
+            tPath_dic = [tPath_dic stringByDeletingLastPathComponent];
+        }
+        if ([imageData writeToFile:tPath atomically:NO]) {
+            return tPath;
+        }
+    }
+    
+    return nil;
+}
+
+- (void)removeStampImage
+{
+    for (NSDictionary *tDict in _deleteList)
+    {
+        NSString *tPath = [tDict objectForKey:@"path"];
+        NSFileManager *tFileManager = [NSFileManager defaultManager];
+        [tFileManager removeItemAtPath:tPath error:nil];
+    }
+}
+
+- (BOOL)saveStampDataToFile:(PDFStampCustomType)stampType
+{
+    NSFileManager *tManager = [NSFileManager defaultManager];
+    
+    switch (stampType)
+    {
+        case PDFStampCustomType_Text:
+            if ([_stampTextList writeToFile:kPDFStampTextList atomically:NO])
+            {
+                return YES;
+            }
+            else
+            {
+                NSString *tPath_dic = kPDFStampTextList;
+                BOOL tIsDirectory = NO;
+                while (1)
+                {
+                    tPath_dic = [tPath_dic stringByDeletingLastPathComponent];
+                    
+                    if ([tManager fileExistsAtPath:tPath_dic isDirectory:&tIsDirectory]) {
+                        if (tIsDirectory)
+                            break;
+                    }
+                    else
+                    {
+                        [tManager createDirectoryAtPath:tPath_dic withIntermediateDirectories:NO attributes:nil error:nil];
+                    }
+                }
+                if ([_stampTextList writeToFile:kPDFStampTextList atomically:NO])
+                {
+                    return YES;
+                }
+            }
+            return NO;
+            
+        case PDFStampCustomType_Image:
+            if ([_stampImageList writeToFile:kPDFStampImageList atomically:NO])
+            {
+                return YES;
+            }
+            else
+            {
+                NSString *tPath_dic = kPDFStampImageList;
+                BOOL tIsDirectory = NO;
+                while (1)
+                {
+                    tPath_dic = [tPath_dic stringByDeletingLastPathComponent];
+                    
+                    if ([tManager fileExistsAtPath:tPath_dic isDirectory:&tIsDirectory]) {
+                        if (tIsDirectory)
+                            break;
+                    }
+                    else
+                    {
+                        [tManager createDirectoryAtPath:tPath_dic withIntermediateDirectories:NO attributes:nil error:nil];
+                    }
+                }
+                if ([_stampImageList writeToFile:kPDFStampImageList atomically:NO])
+                {
+                    return YES;
+                }
+            }
+            return NO;
+            
+        default:
+            return NO;
+    }
+}
+
+- (BOOL)insertStampItem:(NSDictionary *)stampItem type:(PDFStampCustomType)stampType
+{
+    switch (stampType)
+    {
+        case PDFStampCustomType_Text:
+            if (!_stampTextList) {
+                [self readCustomStamp_TextStamp];
+            }
+            
+            if (stampItem)
+            {
+                [_stampTextList addObject:stampItem];
+                if ([self saveStampDataToFile:PDFStampCustomType_Text])
+                    return YES;
+                else
+                    return NO;
+            }
+            else
+                return NO;
+            
+        case PDFStampCustomType_Image:
+            if (!_stampImageList) {
+                [self readCustomStamp_ImageStamp];
+            }
+            
+            if (stampItem)
+            {
+                [_stampImageList addObject:stampItem];
+                if ([self saveStampDataToFile:PDFStampCustomType_Image])
+                    return YES;
+                else
+                    return NO;
+            }
+            else
+                return NO;
+            
+        default:
+            return NO;
+    }
+}
+
+- (BOOL)removeStampItem:(NSInteger)index type:(PDFStampCustomType)stampType
+{
+    switch (stampType)
+    {
+        case PDFStampCustomType_Text:
+            if (!_stampTextList) {
+                [self readCustomStamp_TextStamp];
+            }
+            
+            if (index >= 0 && index <= [_stampTextList count])
+            {
+                [_stampTextList removeObjectAtIndex:index];
+                if ([self saveStampDataToFile:PDFStampCustomType_Text])
+                    return YES;
+                else
+                    return NO;
+            }
+            else
+                return NO;
+            
+        case PDFStampCustomType_Image:
+            if (!_stampImageList) {
+                [self readCustomStamp_ImageStamp];
+            }
+            
+            if (index >= 0 && index < [_stampImageList count])
+            {
+                if (!_deleteList) {
+                    _deleteList = [[NSMutableArray alloc] init];
+                }
+                NSDictionary *tDict = [_stampImageList objectAtIndex:index];
+                [_deleteList addObject:tDict];
+                
+                [_stampImageList removeObjectAtIndex:index];
+                if ([self saveStampDataToFile:PDFStampCustomType_Image])
+                    return YES;
+                else
+                    return NO;
+            }
+            else
+                return NO;
+            
+        default:
+            return NO;
+    }
+}
+
+@end

+ 22 - 0
compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFStamp/Image.xcassets/CPDFStampImage-01.imageset/Contents.json

@@ -0,0 +1,22 @@
+{
+  "images" : [
+    {
+      "filename" : "stamp-01.png",
+      "idiom" : "universal",
+      "scale" : "1x"
+    },
+    {
+      "filename" : "stamp-01@2x.png",
+      "idiom" : "universal",
+      "scale" : "2x"
+    },
+    {
+      "idiom" : "universal",
+      "scale" : "3x"
+    }
+  ],
+  "info" : {
+    "author" : "xcode",
+    "version" : 1
+  }
+}

BIN
compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFStamp/Image.xcassets/CPDFStampImage-01.imageset/stamp-01.png


BIN
compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFStamp/Image.xcassets/CPDFStampImage-01.imageset/stamp-01@2x.png


+ 22 - 0
compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFStamp/Image.xcassets/CPDFStampImage-02.imageset/Contents.json

@@ -0,0 +1,22 @@
+{
+  "images" : [
+    {
+      "filename" : "stamp-02.png",
+      "idiom" : "universal",
+      "scale" : "1x"
+    },
+    {
+      "filename" : "stamp-02@2x.png",
+      "idiom" : "universal",
+      "scale" : "2x"
+    },
+    {
+      "idiom" : "universal",
+      "scale" : "3x"
+    }
+  ],
+  "info" : {
+    "author" : "xcode",
+    "version" : 1
+  }
+}

BIN
compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFStamp/Image.xcassets/CPDFStampImage-02.imageset/stamp-02.png


BIN
compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFStamp/Image.xcassets/CPDFStampImage-02.imageset/stamp-02@2x.png


+ 22 - 0
compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFStamp/Image.xcassets/CPDFStampImage-03.imageset/Contents.json

@@ -0,0 +1,22 @@
+{
+  "images" : [
+    {
+      "filename" : "stamp-03.png",
+      "idiom" : "universal",
+      "scale" : "1x"
+    },
+    {
+      "filename" : "stamp-03@2x.png",
+      "idiom" : "universal",
+      "scale" : "2x"
+    },
+    {
+      "idiom" : "universal",
+      "scale" : "3x"
+    }
+  ],
+  "info" : {
+    "author" : "xcode",
+    "version" : 1
+  }
+}

BIN
compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFStamp/Image.xcassets/CPDFStampImage-03.imageset/stamp-03.png


BIN
compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFStamp/Image.xcassets/CPDFStampImage-03.imageset/stamp-03@2x.png


+ 22 - 0
compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFStamp/Image.xcassets/CPDFStampImage-04.imageset/Contents.json

@@ -0,0 +1,22 @@
+{
+  "images" : [
+    {
+      "filename" : "stamp-04.png",
+      "idiom" : "universal",
+      "scale" : "1x"
+    },
+    {
+      "filename" : "stamp-04@2x.png",
+      "idiom" : "universal",
+      "scale" : "2x"
+    },
+    {
+      "idiom" : "universal",
+      "scale" : "3x"
+    }
+  ],
+  "info" : {
+    "author" : "xcode",
+    "version" : 1
+  }
+}

BIN
compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFStamp/Image.xcassets/CPDFStampImage-04.imageset/stamp-04.png


BIN
compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFStamp/Image.xcassets/CPDFStampImage-04.imageset/stamp-04@2x.png


+ 22 - 0
compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFStamp/Image.xcassets/CPDFStampImage-05.imageset/Contents.json

@@ -0,0 +1,22 @@
+{
+  "images" : [
+    {
+      "filename" : "stamp-05.png",
+      "idiom" : "universal",
+      "scale" : "1x"
+    },
+    {
+      "filename" : "stamp-05@2x.png",
+      "idiom" : "universal",
+      "scale" : "2x"
+    },
+    {
+      "idiom" : "universal",
+      "scale" : "3x"
+    }
+  ],
+  "info" : {
+    "author" : "xcode",
+    "version" : 1
+  }
+}

BIN
compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFStamp/Image.xcassets/CPDFStampImage-05.imageset/stamp-05.png


BIN
compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFStamp/Image.xcassets/CPDFStampImage-05.imageset/stamp-05@2x.png


+ 22 - 0
compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFStamp/Image.xcassets/CPDFStampImage-06.imageset/Contents.json

@@ -0,0 +1,22 @@
+{
+  "images" : [
+    {
+      "filename" : "stamp-06.png",
+      "idiom" : "universal",
+      "scale" : "1x"
+    },
+    {
+      "filename" : "stamp-06@2x.png",
+      "idiom" : "universal",
+      "scale" : "2x"
+    },
+    {
+      "idiom" : "universal",
+      "scale" : "3x"
+    }
+  ],
+  "info" : {
+    "author" : "xcode",
+    "version" : 1
+  }
+}

BIN
compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFStamp/Image.xcassets/CPDFStampImage-06.imageset/stamp-06.png


BIN
compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFStamp/Image.xcassets/CPDFStampImage-06.imageset/stamp-06@2x.png


+ 22 - 0
compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFStamp/Image.xcassets/CPDFStampImage-07.imageset/Contents.json

@@ -0,0 +1,22 @@
+{
+  "images" : [
+    {
+      "filename" : "stamp-07.png",
+      "idiom" : "universal",
+      "scale" : "1x"
+    },
+    {
+      "filename" : "stamp-07@2x.png",
+      "idiom" : "universal",
+      "scale" : "2x"
+    },
+    {
+      "idiom" : "universal",
+      "scale" : "3x"
+    }
+  ],
+  "info" : {
+    "author" : "xcode",
+    "version" : 1
+  }
+}

BIN
compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFStamp/Image.xcassets/CPDFStampImage-07.imageset/stamp-07.png


BIN
compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFStamp/Image.xcassets/CPDFStampImage-07.imageset/stamp-07@2x.png


+ 22 - 0
compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFStamp/Image.xcassets/CPDFStampImage-08.imageset/Contents.json

@@ -0,0 +1,22 @@
+{
+  "images" : [
+    {
+      "filename" : "stamp-08.png",
+      "idiom" : "universal",
+      "scale" : "1x"
+    },
+    {
+      "filename" : "stamp-08@2x.png",
+      "idiom" : "universal",
+      "scale" : "2x"
+    },
+    {
+      "idiom" : "universal",
+      "scale" : "3x"
+    }
+  ],
+  "info" : {
+    "author" : "xcode",
+    "version" : 1
+  }
+}

BIN
compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFStamp/Image.xcassets/CPDFStampImage-08.imageset/stamp-08.png


BIN
compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFStamp/Image.xcassets/CPDFStampImage-08.imageset/stamp-08@2x.png


+ 22 - 0
compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFStamp/Image.xcassets/CPDFStampImage-09.imageset/Contents.json

@@ -0,0 +1,22 @@
+{
+  "images" : [
+    {
+      "filename" : "stamp-09.png",
+      "idiom" : "universal",
+      "scale" : "1x"
+    },
+    {
+      "filename" : "stamp-09@2x.png",
+      "idiom" : "universal",
+      "scale" : "2x"
+    },
+    {
+      "idiom" : "universal",
+      "scale" : "3x"
+    }
+  ],
+  "info" : {
+    "author" : "xcode",
+    "version" : 1
+  }
+}

BIN
compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFStamp/Image.xcassets/CPDFStampImage-09.imageset/stamp-09.png


BIN
compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFStamp/Image.xcassets/CPDFStampImage-09.imageset/stamp-09@2x.png


+ 22 - 0
compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFStamp/Image.xcassets/CPDFStampImage-10.imageset/Contents.json

@@ -0,0 +1,22 @@
+{
+  "images" : [
+    {
+      "filename" : "stamp-10.png",
+      "idiom" : "universal",
+      "scale" : "1x"
+    },
+    {
+      "filename" : "stamp-10@2x.png",
+      "idiom" : "universal",
+      "scale" : "2x"
+    },
+    {
+      "idiom" : "universal",
+      "scale" : "3x"
+    }
+  ],
+  "info" : {
+    "author" : "xcode",
+    "version" : 1
+  }
+}

BIN
compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFStamp/Image.xcassets/CPDFStampImage-10.imageset/stamp-10.png


BIN
compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFStamp/Image.xcassets/CPDFStampImage-10.imageset/stamp-10@2x.png


+ 22 - 0
compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFStamp/Image.xcassets/CPDFStampImage-11.imageset/Contents.json

@@ -0,0 +1,22 @@
+{
+  "images" : [
+    {
+      "filename" : "stamp-11.png",
+      "idiom" : "universal",
+      "scale" : "1x"
+    },
+    {
+      "filename" : "stamp-11@2x.png",
+      "idiom" : "universal",
+      "scale" : "2x"
+    },
+    {
+      "idiom" : "universal",
+      "scale" : "3x"
+    }
+  ],
+  "info" : {
+    "author" : "xcode",
+    "version" : 1
+  }
+}

BIN
compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFStamp/Image.xcassets/CPDFStampImage-11.imageset/stamp-11.png


BIN
compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFStamp/Image.xcassets/CPDFStampImage-11.imageset/stamp-11@2x.png


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

@@ -0,0 +1,22 @@
+{
+  "images" : [
+    {
+      "filename" : "stamp-12.png",
+      "idiom" : "universal",
+      "scale" : "1x"
+    },
+    {
+      "filename" : "stamp-12@2x.png",
+      "idiom" : "universal",
+      "scale" : "2x"
+    },
+    {
+      "idiom" : "universal",
+      "scale" : "3x"
+    }
+  ],
+  "info" : {
+    "author" : "xcode",
+    "version" : 1
+  }
+}

BIN
compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFStamp/Image.xcassets/CPDFStampImage-12.imageset/stamp-12.png


BIN
compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFStamp/Image.xcassets/CPDFStampImage-12.imageset/stamp-12@2x.png


+ 22 - 0
compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFStamp/Image.xcassets/CPDFStampImage-13.imageset/Contents.json

@@ -0,0 +1,22 @@
+{
+  "images" : [
+    {
+      "filename" : "stamp-13.png",
+      "idiom" : "universal",
+      "scale" : "1x"
+    },
+    {
+      "filename" : "stamp-13@2x.png",
+      "idiom" : "universal",
+      "scale" : "2x"
+    },
+    {
+      "idiom" : "universal",
+      "scale" : "3x"
+    }
+  ],
+  "info" : {
+    "author" : "xcode",
+    "version" : 1
+  }
+}

BIN
compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFStamp/Image.xcassets/CPDFStampImage-13.imageset/stamp-13.png


BIN
compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFStamp/Image.xcassets/CPDFStampImage-13.imageset/stamp-13@2x.png


+ 22 - 0
compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFStamp/Image.xcassets/CPDFStampImage-14.imageset/Contents.json

@@ -0,0 +1,22 @@
+{
+  "images" : [
+    {
+      "filename" : "stamp-14.png",
+      "idiom" : "universal",
+      "scale" : "1x"
+    },
+    {
+      "filename" : "stamp-14@2x.png",
+      "idiom" : "universal",
+      "scale" : "2x"
+    },
+    {
+      "idiom" : "universal",
+      "scale" : "3x"
+    }
+  ],
+  "info" : {
+    "author" : "xcode",
+    "version" : 1
+  }
+}

BIN
compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFStamp/Image.xcassets/CPDFStampImage-14.imageset/stamp-14.png


BIN
compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFStamp/Image.xcassets/CPDFStampImage-14.imageset/stamp-14@2x.png


+ 22 - 0
compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFStamp/Image.xcassets/CPDFStampImage-15.imageset/Contents.json

@@ -0,0 +1,22 @@
+{
+  "images" : [
+    {
+      "filename" : "stamp-15.png",
+      "idiom" : "universal",
+      "scale" : "1x"
+    },
+    {
+      "filename" : "stamp-15@2x.png",
+      "idiom" : "universal",
+      "scale" : "2x"
+    },
+    {
+      "idiom" : "universal",
+      "scale" : "3x"
+    }
+  ],
+  "info" : {
+    "author" : "xcode",
+    "version" : 1
+  }
+}

BIN
compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFStamp/Image.xcassets/CPDFStampImage-15.imageset/stamp-15.png


BIN
compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFStamp/Image.xcassets/CPDFStampImage-15.imageset/stamp-15@2x.png


+ 22 - 0
compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFStamp/Image.xcassets/CPDFStampImage-16.imageset/Contents.json

@@ -0,0 +1,22 @@
+{
+  "images" : [
+    {
+      "filename" : "stamp-16.png",
+      "idiom" : "universal",
+      "scale" : "1x"
+    },
+    {
+      "filename" : "stamp-16@2x.png",
+      "idiom" : "universal",
+      "scale" : "2x"
+    },
+    {
+      "idiom" : "universal",
+      "scale" : "3x"
+    }
+  ],
+  "info" : {
+    "author" : "xcode",
+    "version" : 1
+  }
+}

BIN
compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFStamp/Image.xcassets/CPDFStampImage-16.imageset/stamp-16.png


BIN
compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFStamp/Image.xcassets/CPDFStampImage-16.imageset/stamp-16@2x.png


+ 22 - 0
compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFStamp/Image.xcassets/CPDFStampImage-18.imageset/Contents.json

@@ -0,0 +1,22 @@
+{
+  "images" : [
+    {
+      "filename" : "stamp-18.png",
+      "idiom" : "universal",
+      "scale" : "1x"
+    },
+    {
+      "filename" : "stamp-18@2x.png",
+      "idiom" : "universal",
+      "scale" : "2x"
+    },
+    {
+      "idiom" : "universal",
+      "scale" : "3x"
+    }
+  ],
+  "info" : {
+    "author" : "xcode",
+    "version" : 1
+  }
+}

BIN
compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFStamp/Image.xcassets/CPDFStampImage-18.imageset/stamp-18.png


BIN
compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFStamp/Image.xcassets/CPDFStampImage-18.imageset/stamp-18@2x.png


+ 22 - 0
compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFStamp/Image.xcassets/CPDFStampImage-20.imageset/Contents.json

@@ -0,0 +1,22 @@
+{
+  "images" : [
+    {
+      "filename" : "stamp-20.png",
+      "idiom" : "universal",
+      "scale" : "1x"
+    },
+    {
+      "filename" : "stamp-20@2x.png",
+      "idiom" : "universal",
+      "scale" : "2x"
+    },
+    {
+      "idiom" : "universal",
+      "scale" : "3x"
+    }
+  ],
+  "info" : {
+    "author" : "xcode",
+    "version" : 1
+  }
+}

BIN
compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFStamp/Image.xcassets/CPDFStampImage-20.imageset/stamp-20.png


BIN
compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFStamp/Image.xcassets/CPDFStampImage-20.imageset/stamp-20@2x.png


+ 21 - 0
compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFStamp/Image.xcassets/CPDFStampImageImage.imageset/Contents.json

@@ -0,0 +1,21 @@
+{
+  "images" : [
+    {
+      "filename" : "Group (1).pdf",
+      "idiom" : "universal",
+      "scale" : "1x"
+    },
+    {
+      "idiom" : "universal",
+      "scale" : "2x"
+    },
+    {
+      "idiom" : "universal",
+      "scale" : "3x"
+    }
+  ],
+  "info" : {
+    "author" : "xcode",
+    "version" : 1
+  }
+}

+ 99 - 0
compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFStamp/Image.xcassets/CPDFStampImageImage.imageset/Group (1).pdf

@@ -0,0 +1,99 @@
+%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 0.000000 0.000000 cm
+1.000000 1.000000 1.000000 scn
+42.000000 21.000000 m
+42.000000 9.402020 32.597980 0.000000 21.000000 0.000000 c
+9.402020 0.000000 0.000000 9.402020 0.000000 21.000000 c
+0.000000 32.597980 9.402020 42.000000 21.000000 42.000000 c
+32.597980 42.000000 42.000000 32.597980 42.000000 21.000000 c
+h
+f
+n
+Q
+q
+1.000000 0.000000 -0.000000 1.000000 12.250000 14.250000 cm
+0.262745 0.278431 0.301961 scn
+0.000000 13.500000 m
+17.500000 13.500000 l
+17.500000 0.000000 l
+0.000000 0.000000 l
+0.000000 13.500000 l
+h
+16.000000 12.000000 m
+1.500000 12.000000 l
+1.500000 3.540523 l
+4.544956 6.750000 l
+8.814282 3.250000 l
+11.121848 5.682244 l
+15.894180 1.500000 l
+16.000000 1.500000 l
+16.000000 12.000000 l
+h
+13.250000 7.750000 m
+14.078427 7.750000 14.750000 8.421573 14.750000 9.250000 c
+14.750000 10.078426 14.078427 10.750000 13.250000 10.750000 c
+12.421573 10.750000 11.750000 10.078426 11.750000 9.250000 c
+11.750000 8.421573 12.421573 7.750000 13.250000 7.750000 c
+h
+f*
+n
+Q
+
+endstream
+endobj
+
+3 0 obj
+  1048
+endobj
+
+4 0 obj
+  << /Annots []
+     /Type /Page
+     /MediaBox [ 0.000000 0.000000 42.000000 42.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
+0000001138 00000 n
+0000001161 00000 n
+0000001334 00000 n
+0000001408 00000 n
+trailer
+<< /ID [ (some) (id) ]
+   /Root 6 0 R
+   /Size 7
+>>
+startxref
+1467
+%%EOF

+ 21 - 0
compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFStamp/Image.xcassets/CPDFStampImageText.imageset/Contents.json

@@ -0,0 +1,21 @@
+{
+  "images" : [
+    {
+      "filename" : "Group.pdf",
+      "idiom" : "universal",
+      "scale" : "1x"
+    },
+    {
+      "idiom" : "universal",
+      "scale" : "2x"
+    },
+    {
+      "idiom" : "universal",
+      "scale" : "3x"
+    }
+  ],
+  "info" : {
+    "author" : "xcode",
+    "version" : 1
+  }
+}

+ 95 - 0
compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFStamp/Image.xcassets/CPDFStampImageText.imageset/Group.pdf

@@ -0,0 +1,95 @@
+%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 0.000000 0.000000 cm
+1.000000 1.000000 1.000000 scn
+42.000000 21.000000 m
+42.000000 9.402020 32.597980 0.000000 21.000000 0.000000 c
+9.402020 0.000000 0.000000 9.402020 0.000000 21.000000 c
+0.000000 32.597980 9.402020 42.000000 21.000000 42.000000 c
+32.597980 42.000000 42.000000 32.597980 42.000000 21.000000 c
+h
+f
+n
+Q
+q
+1.000000 0.000000 -0.000000 1.000000 14.250000 13.250000 cm
+0.262745 0.278431 0.301961 scn
+13.500000 15.000000 m
+13.500000 11.750000 l
+12.000000 11.750000 l
+12.000000 13.500000 l
+7.500000 13.500000 l
+7.500000 1.500000 l
+9.083332 1.500000 l
+9.083332 0.000000 l
+4.416666 0.000000 l
+4.416666 1.500000 l
+6.000000 1.500000 l
+6.000000 13.500000 l
+1.500000 13.500000 l
+1.500000 11.750000 l
+0.000000 11.750000 l
+0.000000 15.000000 l
+13.500000 15.000000 l
+h
+f*
+n
+Q
+
+endstream
+endobj
+
+3 0 obj
+  845
+endobj
+
+4 0 obj
+  << /Annots []
+     /Type /Page
+     /MediaBox [ 0.000000 0.000000 42.000000 42.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
+0000000935 00000 n
+0000000957 00000 n
+0000001130 00000 n
+0000001204 00000 n
+trailer
+<< /ID [ (some) (id) ]
+   /Root 6 0 R
+   /Size 7
+>>
+startxref
+1263
+%%EOF

+ 22 - 0
compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFStamp/Image.xcassets/CPDFStampImage_chick.imageset/Contents.json

@@ -0,0 +1,22 @@
+{
+  "images" : [
+    {
+      "filename" : "stamp_chick.png",
+      "idiom" : "universal",
+      "scale" : "1x"
+    },
+    {
+      "filename" : "stamp_chick@2x.png",
+      "idiom" : "universal",
+      "scale" : "2x"
+    },
+    {
+      "idiom" : "universal",
+      "scale" : "3x"
+    }
+  ],
+  "info" : {
+    "author" : "xcode",
+    "version" : 1
+  }
+}

BIN
compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFStamp/Image.xcassets/CPDFStampImage_chick.imageset/stamp_chick.png


BIN
compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFStamp/Image.xcassets/CPDFStampImage_chick.imageset/stamp_chick@2x.png


+ 22 - 0
compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFStamp/Image.xcassets/CPDFStampImage_circle.imageset/Contents.json

@@ -0,0 +1,22 @@
+{
+  "images" : [
+    {
+      "filename" : "stamp_circle_01.png",
+      "idiom" : "universal",
+      "scale" : "1x"
+    },
+    {
+      "filename" : "stamp_circle_01@2x.png",
+      "idiom" : "universal",
+      "scale" : "2x"
+    },
+    {
+      "idiom" : "universal",
+      "scale" : "3x"
+    }
+  ],
+  "info" : {
+    "author" : "xcode",
+    "version" : 1
+  }
+}

BIN
compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFStamp/Image.xcassets/CPDFStampImage_circle.imageset/stamp_circle_01.png


BIN
compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFStamp/Image.xcassets/CPDFStampImage_circle.imageset/stamp_circle_01@2x.png


+ 22 - 0
compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFStamp/Image.xcassets/CPDFStampImage_cross.imageset/Contents.json

@@ -0,0 +1,22 @@
+{
+  "images" : [
+    {
+      "filename" : "stamp_cross.png",
+      "idiom" : "universal",
+      "scale" : "1x"
+    },
+    {
+      "filename" : "stamp_cross@2x.png",
+      "idiom" : "universal",
+      "scale" : "2x"
+    },
+    {
+      "idiom" : "universal",
+      "scale" : "3x"
+    }
+  ],
+  "info" : {
+    "author" : "xcode",
+    "version" : 1
+  }
+}

BIN
compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFStamp/Image.xcassets/CPDFStampImage_cross.imageset/stamp_cross.png


BIN
compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFStamp/Image.xcassets/CPDFStampImage_cross.imageset/stamp_cross@2x.png


+ 6 - 0
compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFStamp/Image.xcassets/Contents.json

@@ -0,0 +1,6 @@
+{
+  "info" : {
+    "author" : "xcode",
+    "version" : 1
+  }
+}

+ 2 - 2
compdfkit-tools/compdfkit-tools/Common/Controls/BOTA/CPDFBOTAViewController.m

@@ -76,9 +76,9 @@
     _segmentedControl.selectedSegmentIndex = 0;
     _segmentedControl.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
     [_segmentedControl addTarget:self action:@selector(segmentedControlValueChanged_BOTA:) forControlEvents:UIControlEventValueChanged];
-//    self.navigationItem.titleView = self.segmentedControl;
+    self.navigationItem.titleView = self.segmentedControl;
     [self.view addSubview:self.segmentedControl];
-    self.currentViewController = self.outlineViewController;
+//    self.currentViewController = self.outlineViewController;
     [self.view addSubview:self.outlineViewController.view];
     
     self.doneBtn = [UIButton buttonWithType:UIButtonTypeSystem];

+ 25 - 17
compdfkit-tools/compdfkit-tools/Common/Views/PDFAnnotationBar/CPDFAnnotationBar.m

@@ -26,9 +26,9 @@
 #import "CPDFListView.h"
 #import "CPDFListView+UndoManager.h"
 #import "CPDFListView+Private.h"
-
 #import "CAnnotationManage.h"
 #import "CPDFSignatureEditViewController.h"
+#import "CPDFStampViewController.h"
 #import "CSignatureManager.h"
 #import "CPDFColorUtils.h"
 
@@ -258,7 +258,7 @@
     
     [self updatePropertiesButtonState];
     
-    [self createInkTopToolBar];
+    [self createPropertyViewController];
 }
 
 - (void)buttonItemClicked_open:(UIButton *)button {
@@ -369,15 +369,6 @@
             [self.parentVC presentViewController:freeTextVC animated:YES completion:nil];
         }
             break;
-        case CPDFToolbarSignature:
-        {
-             self.signatureVC = [[CPDFSignatureViewController alloc] initWithStyle:annotStytle];
-            presentationController = [[AAPLCustomPresentationController alloc] initWithPresentedViewController:self.signatureVC presentingViewController:self.parentVC];
-            self.signatureVC.delegate = self;
-            self.signatureVC.transitioningDelegate = presentationController;
-            [self.parentVC presentViewController:self.signatureVC animated:YES completion:nil];
-        }
-            break;
         default:
             break;
     }
@@ -397,7 +388,7 @@
 
 #pragma mark - Private Methods
 
-- (void)createInkTopToolBar {
+- (void)createPropertyViewController {
     if (CPDFViewAnnotationModeInk == self.selectedIndex) {
         if (@available(iOS 11.0, *)) {
             self.topToolBar = [[CPDFInkTopToolBar alloc] initWithFrame:CGRectMake(50, self.parentVC.view.safeAreaInsets.top, self.parentVC.view.frame.size.width-100, 50)];
@@ -412,6 +403,22 @@
             [self.parentVC.view addSubview:self.topToolBar];
         }
         self.alpha = 0.0;
+    } else if (CPDFViewAnnotationModeSignature == self.selectedIndex) {
+        CAnnotStyle *annotStytle = self.annotManage.annotStyle;
+        AAPLCustomPresentationController *presentationController NS_VALID_UNTIL_END_OF_SCOPE;
+        self.signatureVC = [[CPDFSignatureViewController alloc] initWithStyle:annotStytle];
+        presentationController = [[AAPLCustomPresentationController alloc] initWithPresentedViewController:self.signatureVC presentingViewController:self.parentVC];
+        self.signatureVC.delegate = self;
+        self.signatureVC.transitioningDelegate = presentationController;
+        [self.parentVC presentViewController:self.signatureVC animated:YES completion:nil];
+    } else if (CPDFViewAnnotationModeStamp == self.selectedIndex) {
+        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];
+//        stampVC.delegate = self;
+        stampVC.transitioningDelegate = presentationController;
+        [self.parentVC presentViewController:stampVC animated:YES completion:nil];
     }
 }
 
@@ -423,6 +430,12 @@
     [self.parentVC.navigationController pushViewController:editVC animated:NO];
 }
 
+- (void)signatureViewController:(CPDFSignatureViewController *)signatureViewController image:(UIImage *)image {
+    CPDFSignatureAnnotation *annotation = [[CPDFSignatureAnnotation alloc] initWithDocument:self.annotManage.pdfListView.document];
+    [annotation setImage:image];
+    [self.annotManage.pdfListView addAnnotation:annotation];
+}
+
 #pragma mark - CPDFSignatureEditViewControllerDelegate
 
 - (void)signatureEditViewController:(CPDFSignatureEditViewController *)signatureEditViewController image:(UIImage *)image{
@@ -430,11 +443,6 @@
     [self.signatureVC.tableView reloadData];
 }
 
-- (void)signatureEditViewController:(CPDFSignatureEditViewController *)signatureEditViewController text:(NSString *)text {
-    [[CSignatureManager sharedManager] addTextSignature:text];
-    [self.signatureVC.tableView reloadData];
-}
-
 #pragma mark - CPDFNoteViewControllerDelegate
 
 - (void)noteViewController:(CPDFNoteViewController *)noteViewController annotSytle:(CAnnotStyle *)annotStyle {

+ 52 - 7
compdfkit-tools/compdfkit-tools/Common/Views/PDFProperties/CPDFAnnotationSampleView.m

@@ -43,25 +43,70 @@
 - (void)drawRect:(CGRect)rect {
     [super drawRect:rect];
     CGContextRef context = UIGraphicsGetCurrentContext();
-    self.centerRect = CGRectInset(rect, 130, self.bounds.size.height/3);
+    self.centerRect = CGRectInset(rect, 130, (self.bounds.size.height/8)*3);
     self.arrowRect = CGRectInset(rect, 100, 20);
     
     self.textRect = CGRectInset(rect, self.bounds.size.width/3, self.bounds.size.height/3);
     
-    [self drawSamples:context];
+    [self drawSamples:context rect:self.centerRect];
 }
 
 #pragma mark - Private Methods
 
-- (void)drawSamples:(CGContextRef)context {
+- (void)drawSamples:(CGContextRef)context rect:(CGRect)rect {
     CGContextSetAlpha(context, self.opcity);
     switch (self.selecIndex) {
         case CPDFSamplesNote:
         {
-            CGContextSetFillColorWithColor(context, self.fillColor.CGColor);
-            CGContextFillRect(context, self.centerRect);
-            UIImage *image = [UIImage imageNamed:@"CPDFAnnotationBarImageNote" inBundle:[NSBundle bundleForClass:self.class] compatibleWithTraitCollection:nil];
-            [image drawInRect:self.centerRect];
+            CGContextSetRGBStrokeColor(context, 0, 0, 0, 1.0);
+
+            if(self.fillColor) {
+                CGFloat red, green, blue, alpha;
+                [self.fillColor getRed:&red green:&green blue:&blue alpha:&alpha];
+                UIColor *color = [UIColor colorWithRed:red green:green blue:blue alpha:self.opcity];
+                CGContextSetFillColorWithColor(context, color.CGColor);
+            } else {
+                CGContextSetRGBStrokeColor(context, 0.0, 0.0, 0.0, 1.0);
+                CGContextSetFillColorWithColor(context, [UIColor clearColor].CGColor);
+            }
+
+            // Draw outer boxes.
+            CGFloat width = 1.0;
+            CGFloat size = rect.size.height / 5;
+            CGRect outerRect1 = CGRectInset(rect, 0, 0);
+            outerRect1.size.height -= size;
+            CGRect outerRect2 = outerRect1;
+            outerRect2.origin.x += size;
+            outerRect2.origin.y += size*4;
+            outerRect2.size.width = size;
+            outerRect2.size.height = size;
+            
+            CGContextSetLineWidth(context, width);
+            CGContextMoveToPoint(context, CGRectGetMinX(outerRect1), CGRectGetMinY(outerRect1));
+            CGContextAddLineToPoint(context, CGRectGetMinX(outerRect1), CGRectGetMaxY(outerRect1));
+            CGContextAddLineToPoint(context, CGRectGetMinX(outerRect2), CGRectGetMinY(outerRect2));
+            CGContextAddLineToPoint(context, CGRectGetMidX(outerRect2), CGRectGetMaxY(outerRect2));
+            CGContextAddLineToPoint(context, CGRectGetMidX(outerRect2), CGRectGetMinY(outerRect2));
+            CGContextAddLineToPoint(context, CGRectGetMaxX(outerRect1), CGRectGetMaxY(outerRect1));
+            CGContextAddLineToPoint(context, CGRectGetMaxX(outerRect1), CGRectGetMinY(outerRect1));
+            CGContextClosePath(context);
+            CGContextDrawPath(context, kCGPathFillStroke);
+
+            // Draw inner lines.
+            int count = 3;
+            CGFloat xDelta = rect.size.width / 10;
+            CGFloat yDelta = outerRect1.size.height / (count + 1);
+            
+            CGRect lineRect = outerRect1;
+            lineRect.origin.x += xDelta;
+            lineRect.size.width -= 2*xDelta;
+            
+            for (int i=0; i<count; i++) {
+                CGFloat y = CGRectGetMaxY(lineRect) - yDelta * (i + 1);
+                CGContextMoveToPoint(context, CGRectGetMinX(lineRect), y);
+                CGContextAddLineToPoint(context, CGRectGetMaxX(lineRect), y);
+                CGContextStrokePath(context);
+            }
         }
             break;
         case CPDFSamplesHighlight:

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

@@ -84,6 +84,7 @@
         UIButton *button = (UIButton *)self.colorArray[i];
         button.frame = CGRectMake((self.bounds.size.width - ((self.colorPickerView.bounds.size.height - 20)*8))/9 * (i+1) + (self.colorPickerView.bounds.size.height - 20) * i, 5, self.colorPickerView.bounds.size.height - 20, self.colorPickerView.bounds.size.height - 20);
         [[button layer] setCornerRadius:(self.colorPickerView.bounds.size.height - 20)/2];
+        button.layer.masksToBounds = YES;
         button.autoresizingMask = UIViewAutoresizingFlexibleRightMargin | UIViewAutoresizingFlexibleLeftMargin;
         button.backgroundColor = colors[i];
         button.tag = i;

+ 2 - 4
compdfkit-tools/compdfkit-tools/Common/Views/PDFProperties/CPDFOpacitySliderView.m

@@ -37,9 +37,7 @@
         self.startLabel.text = NSLocalizedString(@"100%", nil);
         self.startLabel.layer.borderWidth = 1.0;
         self.startLabel.textAlignment = NSTextAlignmentCenter;
-        self.startLabel.layer.cornerRadius = 6.0;
-        self.startLabel.layer.masksToBounds = YES;
-        self.startLabel.layer.borderColor = [UIColor grayColor].CGColor;
+        self.startLabel.layer.borderColor = [UIColor colorWithRed:0 green:0 blue:0 alpha:0.1].CGColor;
         self.startLabel.autoresizingMask = UIViewAutoresizingFlexibleRightMargin;
         [self addSubview:self.startLabel];
     }
@@ -50,7 +48,7 @@
     [super layoutSubviews];
     self.titleLabel.frame = CGRectMake(10, 0, 50, 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 - 20);
+    self.startLabel.frame = CGRectMake(self.frame.size.width - 90, self.frame.size.height/2 + 10, 80, self.frame.size.height/2 - 15);
 }
 
 #pragma mark - Action

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


Niektóre pliki nie zostały wyświetlone z powodu dużej ilości zmienionych plików