Selaa lähdekoodia

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

chenyu 1 vuosi sitten
vanhempi
commit
2e91ef64c4
42 muutettua tiedostoa jossa 899 lisäystä ja 86 poistoa
  1. 2 0
      Annotation-Ctrl-Demo/Annotation-Ctrl-Demo.xcodeproj/project.pbxproj
  2. 1 1
      Annotation-Ctrl-Demo/Annotation-Ctrl-Demo.xcodeproj/xcuserdata/kdanmobile_2.xcuserdatad/xcschemes/xcschememanagement.plist
  3. 2 0
      Edit-Ctrl-Demo/Edit-Ctrl-Demo.xcodeproj/project.pbxproj
  4. 40 0
      compdfkit-tools/compdfkit-tools.xcodeproj/project.pbxproj
  5. 21 0
      compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFFreeText/CPDFFreeTextViewController.h
  6. 175 0
      compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFFreeText/CPDFFreeTextViewController.m
  7. 1 0
      compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFFreeText/Image.xcassets/CPDFFreeTextImageBold.imageset/BoldNormal.svg
  8. 21 0
      compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFFreeText/Image.xcassets/CPDFFreeTextImageBold.imageset/Contents.json
  9. 1 0
      compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFFreeText/Image.xcassets/CPDFFreeTextImageCenter.imageset/AligmentCenter.svg
  10. 21 0
      compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFFreeText/Image.xcassets/CPDFFreeTextImageCenter.imageset/Contents.json
  11. 1 0
      compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFFreeText/Image.xcassets/CPDFFreeTextImageLeft.imageset/AlignmentLeft.svg
  12. 21 0
      compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFFreeText/Image.xcassets/CPDFFreeTextImageLeft.imageset/Contents.json
  13. 1 0
      compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFFreeText/Image.xcassets/CPDFFreeTextImageRight.imageset/AlignmentRight.svg
  14. 21 0
      compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFFreeText/Image.xcassets/CPDFFreeTextImageRight.imageset/Contents.json
  15. 21 0
      compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFFreeText/Image.xcassets/CPDFFreeTextImageUnderline.imageset/Contents.json
  16. 1 0
      compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFFreeText/Image.xcassets/CPDFFreeTextImageUnderline.imageset/ItalicNormal.svg
  17. 6 0
      compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFFreeText/Image.xcassets/Contents.json
  18. 21 0
      compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFInk/CPDFInkTopToolBar.h
  19. 83 0
      compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFInk/CPDFInkTopToolBar.m
  20. 1 0
      compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFInk/CPDFInkViewController.m
  21. 22 0
      compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFInk/Image.xcassets/CPDFInkImageEraer.imageset/Contents.json
  22. BIN
      compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFInk/Image.xcassets/CPDFInkImageEraer.imageset/btn_eraser_00.png
  23. BIN
      compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFInk/Image.xcassets/CPDFInkImageEraer.imageset/btn_eraser_00@2x.png
  24. 22 0
      compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFInk/Image.xcassets/CPDFInkImageRedo.imageset/Contents.json
  25. BIN
      compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFInk/Image.xcassets/CPDFInkImageRedo.imageset/btn_redo.png
  26. BIN
      compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFInk/Image.xcassets/CPDFInkImageRedo.imageset/btn_redo@2x.png
  27. 22 0
      compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFInk/Image.xcassets/CPDFInkImageUndo.imageset/Contents.json
  28. BIN
      compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFInk/Image.xcassets/CPDFInkImageUndo.imageset/btn_undo.png
  29. BIN
      compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFInk/Image.xcassets/CPDFInkImageUndo.imageset/btn_undo@2x.png
  30. 6 0
      compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFInk/Image.xcassets/Contents.json
  31. 30 7
      compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFShape/CPDFShapeArrowViewController.m
  32. 5 2
      compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFShape/CPDFShapeCircleViewController.m
  33. 33 1
      compdfkit-tools/compdfkit-tools/Common/Views/PDFAnnotationBar/CPDFAnnotationBar.m
  34. 8 0
      compdfkit-tools/compdfkit-tools/Common/Views/PDFProperties/CPDFAnnotationSampleView.h
  35. 114 25
      compdfkit-tools/compdfkit-tools/Common/Views/PDFProperties/CPDFAnnotationSampleView.m
  36. 1 3
      compdfkit-tools/compdfkit-tools/Common/Views/PDFProperties/CPDFArrowStyleCell.m
  37. 10 4
      compdfkit-tools/compdfkit-tools/Common/Views/PDFProperties/CPDFArrowStyleView.h
  38. 16 19
      compdfkit-tools/compdfkit-tools/Common/Views/PDFProperties/CPDFArrowStyleView.m
  39. 1 1
      compdfkit-tools/compdfkit-tools/Common/Views/PDFProperties/CPDFDrawArrowView.h
  40. 14 23
      compdfkit-tools/compdfkit-tools/Common/Views/PDFProperties/CPDFDrawArrowView.m
  41. 33 0
      compdfkit-tools/compdfkit-tools/Common/Views/PDFProperties/CPDFFontStyleTableView.h
  42. 100 0
      compdfkit-tools/compdfkit-tools/Common/Views/PDFProperties/CPDFFontStyleTableView.m

+ 2 - 0
Annotation-Ctrl-Demo/Annotation-Ctrl-Demo.xcodeproj/project.pbxproj

@@ -372,6 +372,7 @@
 				CODE_SIGN_STYLE = Automatic;
 				CURRENT_PROJECT_VERSION = 1;
 				DEVELOPMENT_TEAM = Q43DRF894U;
+				"EXCLUDED_ARCHS[sdk=iphonesimulator*]" = arm64;
 				GENERATE_INFOPLIST_FILE = YES;
 				INFOPLIST_FILE = "Annotation-Ctrl-Demo/Info.plist";
 				INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES;
@@ -401,6 +402,7 @@
 				CODE_SIGN_STYLE = Automatic;
 				CURRENT_PROJECT_VERSION = 1;
 				DEVELOPMENT_TEAM = Q43DRF894U;
+				"EXCLUDED_ARCHS[sdk=iphonesimulator*]" = arm64;
 				GENERATE_INFOPLIST_FILE = YES;
 				INFOPLIST_FILE = "Annotation-Ctrl-Demo/Info.plist";
 				INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES;

+ 1 - 1
Annotation-Ctrl-Demo/Annotation-Ctrl-Demo.xcodeproj/xcuserdata/kdanmobile_2.xcuserdatad/xcschemes/xcschememanagement.plist

@@ -7,7 +7,7 @@
 		<key>Annotation-Ctrl-Demo.xcscheme_^#shared#^_</key>
 		<dict>
 			<key>orderHint</key>
-			<integer>1</integer>
+			<integer>3</integer>
 		</dict>
 	</dict>
 </dict>

+ 2 - 0
Edit-Ctrl-Demo/Edit-Ctrl-Demo.xcodeproj/project.pbxproj

@@ -385,6 +385,7 @@
 				CODE_SIGN_STYLE = Automatic;
 				CURRENT_PROJECT_VERSION = 1;
 				DEVELOPMENT_TEAM = 4GGQPGRTSV;
+				"EXCLUDED_ARCHS[sdk=iphonesimulator*]" = arm64;
 				GENERATE_INFOPLIST_FILE = YES;
 				INFOPLIST_FILE = "Edit-Ctrl-Demo/Info.plist";
 				INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES;
@@ -413,6 +414,7 @@
 				CODE_SIGN_STYLE = Automatic;
 				CURRENT_PROJECT_VERSION = 1;
 				DEVELOPMENT_TEAM = 4GGQPGRTSV;
+				"EXCLUDED_ARCHS[sdk=iphonesimulator*]" = arm64;
 				GENERATE_INFOPLIST_FILE = YES;
 				INFOPLIST_FILE = "Edit-Ctrl-Demo/Info.plist";
 				INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES;

+ 40 - 0
compdfkit-tools/compdfkit-tools.xcodeproj/project.pbxproj

@@ -61,6 +61,14 @@
 		C918CEE029FB943400D43974 /* CPDFArrowStyleCell.m in Sources */ = {isa = PBXBuildFile; fileRef = C918CEDE29FB943400D43974 /* CPDFArrowStyleCell.m */; };
 		C918CEE329FBA41A00D43974 /* CPDFDrawArrowView.h in Headers */ = {isa = PBXBuildFile; fileRef = C918CEE129FBA41A00D43974 /* CPDFDrawArrowView.h */; };
 		C918CEE429FBA41A00D43974 /* CPDFDrawArrowView.m in Sources */ = {isa = PBXBuildFile; fileRef = C918CEE229FBA41A00D43974 /* CPDFDrawArrowView.m */; };
+		C91BE7C32A02352B0038F2BC /* CPDFFreeTextViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = C91BE7C12A02352B0038F2BC /* CPDFFreeTextViewController.h */; };
+		C91BE7C42A02352B0038F2BC /* CPDFFreeTextViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = C91BE7C22A02352B0038F2BC /* CPDFFreeTextViewController.m */; };
+		C91BE7C62A0243E80038F2BC /* Image.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = C91BE7C52A0243E70038F2BC /* Image.xcassets */; };
+		C91BE7C92A0347770038F2BC /* CPDFFontStyleTableView.h in Headers */ = {isa = PBXBuildFile; fileRef = C91BE7C72A0347770038F2BC /* CPDFFontStyleTableView.h */; };
+		C91BE7CA2A0347770038F2BC /* CPDFFontStyleTableView.m in Sources */ = {isa = PBXBuildFile; fileRef = C91BE7C82A0347770038F2BC /* CPDFFontStyleTableView.m */; };
+		C91BE7CD2A037A490038F2BC /* CPDFInkTopToolBar.h in Headers */ = {isa = PBXBuildFile; fileRef = C91BE7CB2A037A490038F2BC /* CPDFInkTopToolBar.h */; };
+		C91BE7CE2A037A490038F2BC /* CPDFInkTopToolBar.m in Sources */ = {isa = PBXBuildFile; fileRef = C91BE7CC2A037A490038F2BC /* CPDFInkTopToolBar.m */; };
+		C91BE7D02A037B080038F2BC /* Image.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = C91BE7CF2A037B080038F2BC /* Image.xcassets */; };
 		C9AF182629EE8AB600EC4979 /* UtilsColor.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = C9AF182529EE8AB600EC4979 /* UtilsColor.xcassets */; };
 		C9AF182C29EFB1FC00EC4979 /* CPDFBookmarkViewCell.h in Headers */ = {isa = PBXBuildFile; fileRef = C9AF182A29EFB1FC00EC4979 /* CPDFBookmarkViewCell.h */; };
 		C9AF182D29EFB1FC00EC4979 /* CPDFBookmarkViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = C9AF182B29EFB1FC00EC4979 /* CPDFBookmarkViewCell.m */; };
@@ -207,6 +215,14 @@
 		C918CEDE29FB943400D43974 /* CPDFArrowStyleCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = CPDFArrowStyleCell.m; sourceTree = "<group>"; };
 		C918CEE129FBA41A00D43974 /* CPDFDrawArrowView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CPDFDrawArrowView.h; sourceTree = "<group>"; };
 		C918CEE229FBA41A00D43974 /* CPDFDrawArrowView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = CPDFDrawArrowView.m; sourceTree = "<group>"; };
+		C91BE7C12A02352B0038F2BC /* CPDFFreeTextViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CPDFFreeTextViewController.h; sourceTree = "<group>"; };
+		C91BE7C22A02352B0038F2BC /* CPDFFreeTextViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = CPDFFreeTextViewController.m; sourceTree = "<group>"; };
+		C91BE7C52A0243E70038F2BC /* Image.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Image.xcassets; sourceTree = "<group>"; };
+		C91BE7C72A0347770038F2BC /* CPDFFontStyleTableView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CPDFFontStyleTableView.h; sourceTree = "<group>"; };
+		C91BE7C82A0347770038F2BC /* CPDFFontStyleTableView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = CPDFFontStyleTableView.m; sourceTree = "<group>"; };
+		C91BE7CB2A037A490038F2BC /* CPDFInkTopToolBar.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CPDFInkTopToolBar.h; sourceTree = "<group>"; };
+		C91BE7CC2A037A490038F2BC /* CPDFInkTopToolBar.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = CPDFInkTopToolBar.m; sourceTree = "<group>"; };
+		C91BE7CF2A037B080038F2BC /* Image.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Image.xcassets; sourceTree = "<group>"; };
 		C9AF182529EE8AB600EC4979 /* UtilsColor.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = UtilsColor.xcassets; sourceTree = "<group>"; };
 		C9AF182A29EFB1FC00EC4979 /* CPDFBookmarkViewCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CPDFBookmarkViewCell.h; sourceTree = "<group>"; };
 		C9AF182B29EFB1FC00EC4979 /* CPDFBookmarkViewCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = CPDFBookmarkViewCell.m; sourceTree = "<group>"; };
@@ -420,6 +436,9 @@
 			children = (
 				C918CEC729FA140C00D43974 /* CPDFInkViewController.h */,
 				C918CEC829FA140C00D43974 /* CPDFInkViewController.m */,
+				C91BE7CB2A037A490038F2BC /* CPDFInkTopToolBar.h */,
+				C91BE7CC2A037A490038F2BC /* CPDFInkTopToolBar.m */,
+				C91BE7CF2A037B080038F2BC /* Image.xcassets */,
 			);
 			path = PDFInk;
 			sourceTree = "<group>";
@@ -437,6 +456,16 @@
 			path = PDFShape;
 			sourceTree = "<group>";
 		};
+		C91BE7C02A0234CB0038F2BC /* PDFFreeText */ = {
+			isa = PBXGroup;
+			children = (
+				C91BE7C12A02352B0038F2BC /* CPDFFreeTextViewController.h */,
+				C91BE7C22A02352B0038F2BC /* CPDFFreeTextViewController.m */,
+				C91BE7C52A0243E70038F2BC /* Image.xcassets */,
+			);
+			path = PDFFreeText;
+			sourceTree = "<group>";
+		};
 		C949FEE029EE70D000C30A8D /* Utils */ = {
 			isa = PBXGroup;
 			children = (
@@ -495,6 +524,7 @@
 		C9AF188A29F4C7C900EC4979 /* PDFProperties */ = {
 			isa = PBXGroup;
 			children = (
+				C91BE7C02A0234CB0038F2BC /* PDFFreeText */,
 				C918CECB29FA432D00D43974 /* PDFShape */,
 				C918CEC629FA13EF00D43974 /* PDFInk */,
 				C918CEC529FA0C7D00D43974 /* PDFSquiggly */,
@@ -537,6 +567,8 @@
 				C918CEDE29FB943400D43974 /* CPDFArrowStyleCell.m */,
 				C918CEE129FBA41A00D43974 /* CPDFDrawArrowView.h */,
 				C918CEE229FBA41A00D43974 /* CPDFDrawArrowView.m */,
+				C91BE7C72A0347770038F2BC /* CPDFFontStyleTableView.h */,
+				C91BE7C82A0347770038F2BC /* CPDFFontStyleTableView.m */,
 				C918CE8329F62D6F00D43974 /* Image.xcassets */,
 			);
 			path = PDFProperties;
@@ -820,6 +852,7 @@
 				C918CE9B29F8EE7200D43974 /* CPDFHighlightViewController.h in Headers */,
 				F32DA18129ED904300E19ECA /* CNavigationRightView.h in Headers */,
 				C918CE8129F621E200D43974 /* CPDFColorPickerView.h in Headers */,
+				C91BE7C92A0347770038F2BC /* CPDFFontStyleTableView.h in Headers */,
 				F32DA16A29ED904300E19ECA /* CPDFSearchViewCell.h in Headers */,
 				4F5986912A03411700F06A1B /* CPDFDropDownMenu.h in Headers */,
 				F32DA18529ED904300E19ECA /* CActivityIndicatorView.h in Headers */,
@@ -837,6 +870,7 @@
 				4F06AB5429F6792E007797E4 /* CPDFTextProperty.h in Headers */,
 				F382636B29EFD0D9003F1DFD /* CPDFSlider.h in Headers */,
 				4F6C796A29FBD532008C9501 /* CPDFEditFontNameSelectView.h in Headers */,
+				C91BE7CD2A037A490038F2BC /* CPDFInkTopToolBar.h in Headers */,
 				C918CEA529F8FC1800D43974 /* CPDFUnderlineViewController.h in Headers */,
 				C918CECE29FA43B800D43974 /* CPDFShapeCircleViewController.h in Headers */,
 				C9AF184129F22BBD00EC4979 /* CPDFAnnotationBarButton.h in Headers */,
@@ -854,6 +888,7 @@
 				F382636829EFD0D9003F1DFD /* CPDFPageIndicatorView.h in Headers */,
 				C9B9EC4A29F4DC8900C6A5D2 /* CPDFThicknessSliderView.h in Headers */,
 				C918CEDB29FB73C800D43974 /* CPDFArrowStyleView.h in Headers */,
+				C91BE7C32A02352B0038F2BC /* CPDFFreeTextViewController.h in Headers */,
 				C9AF182C29EFB1FC00EC4979 /* CPDFBookmarkViewCell.h in Headers */,
 				4F1131AF29F8EEA800950564 /* CPDFEditViewController.h in Headers */,
 				F32DA16529ED904300E19ECA /* CPDFOutlineViewController.h in Headers */,
@@ -941,9 +976,11 @@
 				F3E8495929E69712007BE967 /* DisplayImage.xcassets in Resources */,
 				F32DA17C29ED904300E19ECA /* DisplayImage.xcassets in Resources */,
 				F32DA16329ED904300E19ECA /* Image.xcassets in Resources */,
+				C91BE7D02A037B080038F2BC /* Image.xcassets in Resources */,
 				F32DA18229ED904300E19ECA /* NavigationRightImage.xcassets in Resources */,
 				C9AF183E29F223A700EC4979 /* Image.xcassets in Resources */,
 				C918CE8429F62D6F00D43974 /* Image.xcassets in Resources */,
+				C91BE7C62A0243E80038F2BC /* Image.xcassets in Resources */,
 				C9AF182629EE8AB600EC4979 /* UtilsColor.xcassets in Resources */,
 				4F1131BE29F9232300950564 /* CPDFEditImageAssets.xcassets in Resources */,
 				4F1131BC29F911A800950564 /* CPDFTextPropertyCell.xib in Resources */,
@@ -961,6 +998,7 @@
 			buildActionMask = 2147483647;
 			files = (
 				F32DA17B29ED904300E19ECA /* CPDFDisplayViewController.m in Sources */,
+				C91BE7CA2A0347770038F2BC /* CPDFFontStyleTableView.m in Sources */,
 				C918CE9329F7C3FB00D43974 /* CAnnotationManage.m in Sources */,
 				C918CEC029F9078A00D43974 /* CPDFNoteOpenViewController.m in Sources */,
 				C918CE9729F8BA6200D43974 /* CPDFNoteViewController.m in Sources */,
@@ -970,6 +1008,7 @@
 				F382636D29EFD0D9003F1DFD /* CPDFListView.m in Sources */,
 				C9AF184229F22BBD00EC4979 /* CPDFAnnotationBarButton.m in Sources */,
 				F32DA17329ED904300E19ECA /* CPDFThumbnailViewController.m in Sources */,
+				C91BE7C42A02352B0038F2BC /* CPDFFreeTextViewController.m in Sources */,
 				C918CEDC29FB73C800D43974 /* CPDFArrowStyleView.m in Sources */,
 				C9B9EC4B29F4DC8900C6A5D2 /* CPDFThicknessSliderView.m in Sources */,
 				C9B9EC5A29F54E9600C6A5D2 /* CAnnotStyle.m in Sources */,
@@ -1010,6 +1049,7 @@
 				C9AF183129EFB23C00EC4979 /* CPDFBookmarkViewController.m in Sources */,
 				C918CE8229F621E200D43974 /* CPDFColorPickerView.m in Sources */,
 				F32DA17629ED904300E19ECA /* CPDFInfoViewController.m in Sources */,
+				C91BE7CE2A037A490038F2BC /* CPDFInkTopToolBar.m in Sources */,
 				C918CE9C29F8EE7200D43974 /* CPDFHighlightViewController.m in Sources */,
 				C918CEE029FB943400D43974 /* CPDFArrowStyleCell.m in Sources */,
 				C9AF189829F4DA6A00EC4979 /* CPDFColorSelectView.m in Sources */,

+ 21 - 0
compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFFreeText/CPDFFreeTextViewController.h

@@ -0,0 +1,21 @@
+//
+//  CPDFFreeTextViewController.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 <compdfkit_tools/compdfkit_tools.h>
+
+NS_ASSUME_NONNULL_BEGIN
+
+@interface CPDFFreeTextViewController : CPDFAnnotationBaseViewController
+
+@end
+
+NS_ASSUME_NONNULL_END

+ 175 - 0
compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFFreeText/CPDFFreeTextViewController.m

@@ -0,0 +1,175 @@
+//
+//  CPDFFreeTextViewController.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 "CPDFFreeTextViewController.h"
+#import "CPDFAnnotationBaseViewController_Header.h"
+#import "CPDFThicknessSliderView.h"
+#import "CPDFFontStyleTableView.h"
+
+@interface CPDFFreeTextViewController () <CPDFThicknessSliderViewDelegate, CPDFFontStyleTableViewDelegate>
+
+@property (nonatomic, strong) UIButton *fontStyleBtn;
+
+@property (nonatomic, strong) UIButton *boldBtn;
+
+@property (nonatomic, strong) UIButton *underlineBtn;
+
+@property (nonatomic, strong) UILabel *alignmentLabel;
+
+@property (nonatomic, strong) UIButton *leftBtn;
+
+@property (nonatomic, strong) UIButton *centerBtn;
+
+@property (nonatomic, strong) UIButton *rightBtn;
+
+@property (nonatomic, strong) CPDFThicknessSliderView *fontsizeSliderView;
+
+@property (nonatomic, assign) BOOL isBold;
+
+@property (nonatomic, assign) BOOL isUnderline;
+
+@property (nonatomic, strong) CPDFFontStyleTableView *fontStyleTableView;
+
+@end
+
+@implementation CPDFFreeTextViewController
+
+#pragma mark - ViewController Methods
+
+- (void)viewDidLoad {
+    [super viewDidLoad];
+    // Do any additional setup after loading the view.
+    self.fontStyleBtn = [[UIButton alloc] init];
+    [self.fontStyleBtn setTitle:NSLocalizedString(@"Font Style", nil) forState:UIControlStateNormal];
+    [self.fontStyleBtn setTitleColor:[UIColor blueColor] forState:UIControlStateNormal];
+    [self.fontStyleBtn addTarget:self action:@selector(buttonItemClicked_FontStyle:) forControlEvents:UIControlEventTouchUpInside];
+    [self.view addSubview:self.fontStyleBtn];
+    
+    self.boldBtn = [[UIButton alloc] init];
+    [self.boldBtn setImage:[UIImage imageNamed:@"CPDFFreeTextImageBold" inBundle:[NSBundle bundleForClass:self.class] compatibleWithTraitCollection:nil] forState:UIControlStateNormal];
+    [self.boldBtn addTarget:self action:@selector(buttonItemClicked_Bold:) forControlEvents:UIControlEventTouchUpInside];
+    [self.view addSubview:self.boldBtn];
+    
+    self.underlineBtn = [[UIButton alloc] init];
+    [self.underlineBtn setImage:[UIImage imageNamed:@"CPDFFreeTextImageUnderline" inBundle:[NSBundle bundleForClass:self.class] compatibleWithTraitCollection:nil] forState:UIControlStateNormal];
+    [self.underlineBtn addTarget:self action:@selector(buttonItemClicked_Underline:) forControlEvents:UIControlEventTouchUpInside];
+    [self.view addSubview:self.underlineBtn];
+    
+    self.alignmentLabel = [[UILabel alloc] init];
+    self.alignmentLabel.text = NSLocalizedString(@"Alignment Mode", nil);
+    self.alignmentLabel.adjustsFontSizeToFitWidth = YES;
+    [self.view addSubview:self.alignmentLabel];
+    
+    self.leftBtn = [[UIButton alloc] init];
+    [self.leftBtn setImage:[UIImage imageNamed:@"CPDFFreeTextImageLeft" inBundle:[NSBundle bundleForClass:self.class] compatibleWithTraitCollection:nil] forState:UIControlStateNormal];
+    [self.leftBtn addTarget:self action:@selector(buttonItemClicked_Left:) forControlEvents:UIControlEventTouchUpInside];
+    [self.view addSubview:self.leftBtn];
+    
+    self.centerBtn = [[UIButton alloc] init];
+    [self.centerBtn setImage:[UIImage imageNamed:@"CPDFFreeTextImageCenter" inBundle:[NSBundle bundleForClass:self.class] compatibleWithTraitCollection:nil] forState:UIControlStateNormal];
+    [self.centerBtn addTarget:self action:@selector(buttonItemClicked_Center:) forControlEvents:UIControlEventTouchUpInside];
+    [self.view addSubview:self.centerBtn];
+    
+    self.rightBtn = [[UIButton alloc] init];
+    [self.rightBtn setImage:[UIImage imageNamed:@"CPDFFreeTextImageRight" inBundle:[NSBundle bundleForClass:self.class] compatibleWithTraitCollection:nil] forState:UIControlStateNormal];
+    [self.rightBtn addTarget:self action:@selector(buttonItemClicked_Right:) forControlEvents:UIControlEventTouchUpInside];
+    [self.view addSubview:self.rightBtn];
+    
+    self.fontsizeSliderView = [[CPDFThicknessSliderView alloc] init];
+    self.fontsizeSliderView.thicknessSlider.value = 20;
+    self.fontsizeSliderView.thicknessSlider.minimumValue = 1;
+    self.fontsizeSliderView.thicknessSlider.maximumValue = 100;
+    self.fontsizeSliderView.titleLabel.text = NSLocalizedString(@"Font Size", nil);
+    self.fontsizeSliderView.startLabel.text = @"1";
+    self.fontsizeSliderView.endLabel.text = @"100";
+    self.fontsizeSliderView.delegate = self;
+    self.fontsizeSliderView.autoresizingMask = UIViewAutoresizingFlexibleWidth;
+    [self.view addSubview:self.fontsizeSliderView];
+    
+    self.isBold = NO;
+    self.isUnderline = NO;
+}
+
+- (void)viewWillLayoutSubviews {
+    [super viewWillLayoutSubviews];
+    self.fontStyleBtn.frame = CGRectMake(10, 370, 180, 45);
+    self.boldBtn.frame = CGRectMake(self.view.frame.size.width - 80, 385, 30, 30);
+    self.underlineBtn.frame = CGRectMake(self.view.frame.size.width - 40, 385, 30, 30);
+    self.alignmentLabel.frame = CGRectMake(10, 415, 120, 45);
+    self.leftBtn.frame = CGRectMake(self.view.frame.size.width - 120, 430, 30, 30);
+    self.centerBtn.frame = CGRectMake(self.view.frame.size.width - 80, 430, 30, 30);
+    self.rightBtn.frame = CGRectMake(self.view.frame.size.width - 40, 430, 30, 30);
+    self.fontsizeSliderView.frame = CGRectMake(10, 450, self.view.frame.size.width - 20, 90);
+}
+
+#pragma mark - Protect Mehtods
+
+- (void)commomInitTitle {
+    self.titleLabel.text = NSLocalizedString(@"Free Text", nil);
+    self.sampleView.selecIndex = CPDFSamplesFreeText;
+    self.sampleView.fontName = @"Helvetica";
+    self.sampleView.fillColor = [UIColor blueColor];
+    self.sampleView.thickness = 20;
+}
+
+- (void)updatePreferredContentSizeWithTraitCollection:(UITraitCollection *)traitCollection {
+    self.preferredContentSize = CGSizeMake(self.view.bounds.size.width, traitCollection.verticalSizeClass == UIUserInterfaceSizeClassCompact ? 270 : 600);
+}
+
+#pragma mark - Action
+
+- (void)buttonItemClicked_Bold:(id)sender {
+    self.isBold = !(self.isBold);
+    self.sampleView.isBold = self.isBold;
+    [self.sampleView setNeedsDisplay];
+}
+
+- (void)buttonItemClicked_Underline:(id)sender {
+    self.isUnderline = !(self.isUnderline);
+    self.sampleView.isUnderline = self.isUnderline;
+    [self.sampleView setNeedsDisplay];
+}
+
+- (void)buttonItemClicked_FontStyle:(id)sender {
+    self.fontStyleTableView = [[CPDFFontStyleTableView alloc] initWithFrame:self.view.bounds];
+    self.fontStyleTableView.delegate = self;
+    self.fontStyleTableView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
+    [self.view addSubview:self.fontStyleTableView];
+}
+
+- (void)buttonItemClicked_Left:(id)sender {
+    
+}
+
+- (void)buttonItemClicked_Center:(id)sender {
+    
+}
+
+- (void)buttonItemClicked_Right:(id)sender {
+    
+}
+
+#pragma mark - CPDFThicknessSliderViewDelegate
+
+- (void)thicknessSliderView:(CPDFThicknessSliderView *)thicknessSliderView thickness:(CGFloat)thickness {
+    self.sampleView.thickness = thickness;
+    [self.sampleView setNeedsDisplay];
+}
+
+#pragma mark - CPDFFontStyleTableViewDelegate
+
+- (void)fontStyleTableView:(CPDFFontStyleTableView *)fontStyleTableView fontName:(NSString *)fontName {
+    self.sampleView.fontName = fontName;
+    [self.sampleView setNeedsDisplay];
+}
+
+@end

Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 1 - 0
compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFFreeText/Image.xcassets/CPDFFreeTextImageBold.imageset/BoldNormal.svg


+ 21 - 0
compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFFreeText/Image.xcassets/CPDFFreeTextImageBold.imageset/Contents.json

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

+ 1 - 0
compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFFreeText/Image.xcassets/CPDFFreeTextImageCenter.imageset/AligmentCenter.svg

@@ -0,0 +1 @@
+<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1682584920188" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5240" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M96 128h832v96H96zM96 576h832v96H96zM224 352h576v96H224zM224 800h576v96H224z" p-id="5241"></path></svg>

+ 21 - 0
compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFFreeText/Image.xcassets/CPDFFreeTextImageCenter.imageset/Contents.json

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

+ 1 - 0
compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFFreeText/Image.xcassets/CPDFFreeTextImageLeft.imageset/AlignmentLeft.svg

@@ -0,0 +1 @@
+<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1682584933370" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="6254" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M96 128h832v96H96zM96 576h832v96H96zM96 352h576v96H96zM96 800h576v96H96z" p-id="6255"></path></svg>

+ 21 - 0
compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFFreeText/Image.xcassets/CPDFFreeTextImageLeft.imageset/Contents.json

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

+ 1 - 0
compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFFreeText/Image.xcassets/CPDFFreeTextImageRight.imageset/AlignmentRight.svg

@@ -0,0 +1 @@
+<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1682584902978" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4215" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M96 128h832v96H96zM96 576h832v96H96zM352 352h576v96H352zM352 800h576v96H352z" p-id="4216"></path></svg>

+ 21 - 0
compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFFreeText/Image.xcassets/CPDFFreeTextImageRight.imageset/Contents.json

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

+ 21 - 0
compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFFreeText/Image.xcassets/CPDFFreeTextImageUnderline.imageset/Contents.json

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

Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 1 - 0
compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFFreeText/Image.xcassets/CPDFFreeTextImageUnderline.imageset/ItalicNormal.svg


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

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

+ 21 - 0
compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFInk/CPDFInkTopToolBar.h

@@ -0,0 +1,21 @@
+//
+//  CPDFFreehandView.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 CPDFInkTopToolBar : UIView
+
+@end
+
+NS_ASSUME_NONNULL_END

+ 83 - 0
compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFInk/CPDFInkTopToolBar.m

@@ -0,0 +1,83 @@
+//
+//  CPDFFreehandView.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 "CPDFInkTopToolBar.h"
+
+@interface CPDFInkTopToolBar ()
+
+@end
+
+@implementation CPDFInkTopToolBar
+
+#pragma mark - Initializers
+
+- (instancetype)initWithFrame:(CGRect)frame {
+    if (self = [super initWithFrame:frame]) {
+        self.backgroundColor = [UIColor colorWithRed:255.0/255.0 green:255.0/255.0  blue:255.0/255.0  alpha:1.0];
+        self.layer.borderColor = [UIColor colorWithRed:170.0/255.0 green:170.0/255.0  blue:170.0/255.0  alpha:1.0].CGColor;
+        self.layer.borderWidth = 1.0;
+        self.layer.cornerRadius = 5.0;
+        
+        CGFloat width = self.bounds.size.width/5;
+        CGFloat height = self.bounds.size.height;
+        
+        UIButton *undoButton = [[UIButton alloc] init];
+        undoButton.tag = 0;
+        undoButton.frame = CGRectMake(width, 0, width, height);
+        [undoButton setImage:[UIImage imageNamed:@"CPDFInkImageUndo" inBundle:[NSBundle bundleForClass:self.class] compatibleWithTraitCollection:nil] forState:UIControlStateNormal];
+        [undoButton addTarget:self action:@selector(buttonItemClicked_Switch:) forControlEvents:UIControlEventTouchUpInside];
+        [self addSubview:undoButton];
+        
+        UIButton *redoButton = [UIButton buttonWithType:UIButtonTypeCustom];
+        redoButton.tag = 1;
+        redoButton.frame = CGRectMake(width*2, 0, width, height);
+        [redoButton setImage:[UIImage imageNamed:@"CPDFInkImageRedo" inBundle:[NSBundle bundleForClass:self.class] compatibleWithTraitCollection:nil] forState:UIControlStateNormal];
+        [redoButton addTarget:self action:@selector(buttonItemClicked_Switch:) forControlEvents:UIControlEventTouchUpInside];
+        [self addSubview:redoButton];
+        
+        UIButton *eraseButton = [UIButton buttonWithType:UIButtonTypeCustom];
+        eraseButton.tag = 2;
+        eraseButton.frame = CGRectMake(0, 0, width, height);
+        [eraseButton setImage:[UIImage imageNamed:@"CPDFInkImageEraer" inBundle:[NSBundle bundleForClass:self.class] compatibleWithTraitCollection:nil] forState:UIControlStateNormal];
+        [eraseButton addTarget:self action:@selector(buttonItemClicked_Switch:) forControlEvents:UIControlEventTouchUpInside];
+        [self addSubview:eraseButton];
+        
+        UIButton *clearButton = [UIButton buttonWithType:UIButtonTypeSystem];
+        clearButton.tag = 3;
+        clearButton.frame = CGRectMake(3*width, 0, width, height);
+        [clearButton setTitle:NSLocalizedString(@"Clear", nil) forState:UIControlStateNormal];
+        [clearButton setTitleColor:[UIColor colorWithRed:243.0/255.0 green:0 blue:8.0/255.0 alpha:1.0] forState:UIControlStateNormal];
+        clearButton.titleLabel.font = [UIFont systemFontOfSize:15.0];
+        [clearButton addTarget:self action:@selector(buttonItemClicked_Switch:) forControlEvents:UIControlEventTouchUpInside];
+        [self addSubview:clearButton];
+        
+        UIButton *saveButton = [UIButton buttonWithType:UIButtonTypeSystem];
+        saveButton.tag = 3;
+        saveButton.frame = CGRectMake(4*width, 0, width, height);
+        [saveButton setTitle:NSLocalizedString(@"Done", nil) forState:UIControlStateNormal];
+        [saveButton setTitleColor:[UIColor colorWithRed:41.0/255.0 green:111.0/255.0 blue:173.0/255.0 alpha:1.0] forState:UIControlStateNormal];
+        saveButton.titleLabel.font = [UIFont systemFontOfSize:15.0];
+        [saveButton addTarget:self action:@selector(buttonItemClicked_Switch:) forControlEvents:UIControlEventTouchUpInside];
+        [self addSubview:saveButton];
+    }
+    return self;
+ }
+
+#pragma mark - Action
+
+- (void)buttonItemClicked_Switch:(UIButton *)button {
+    if (button.tag == 3) {
+        [self removeFromSuperview];
+    }
+}
+
+@end

+ 1 - 0
compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFInk/CPDFInkViewController.m

@@ -13,6 +13,7 @@
 #import "CPDFInkViewController.h"
 #import "CPDFAnnotationBaseViewController_Header.h"
 #import "CPDFThicknessSliderView.h"
+#import "CPDFInkTopToolBar.h"
 
 @interface CPDFInkViewController () <CPDFThicknessSliderViewDelegate>
 

+ 22 - 0
compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFInk/Image.xcassets/CPDFInkImageEraer.imageset/Contents.json

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

BIN
compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFInk/Image.xcassets/CPDFInkImageEraer.imageset/btn_eraser_00.png


BIN
compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFInk/Image.xcassets/CPDFInkImageEraer.imageset/btn_eraser_00@2x.png


+ 22 - 0
compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFInk/Image.xcassets/CPDFInkImageRedo.imageset/Contents.json

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

BIN
compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFInk/Image.xcassets/CPDFInkImageRedo.imageset/btn_redo.png


BIN
compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFInk/Image.xcassets/CPDFInkImageRedo.imageset/btn_redo@2x.png


+ 22 - 0
compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFInk/Image.xcassets/CPDFInkImageUndo.imageset/Contents.json

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

BIN
compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFInk/Image.xcassets/CPDFInkImageUndo.imageset/btn_undo.png


BIN
compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFInk/Image.xcassets/CPDFInkImageUndo.imageset/btn_undo@2x.png


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

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

+ 30 - 7
compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFShape/CPDFShapeArrowViewController.m

@@ -14,7 +14,7 @@
 #import "CPDFShareCircleViewController_Header.h"
 #import "CPDFArrowStyleView.h"
 
-@interface CPDFShapeArrowViewController ()
+@interface CPDFShapeArrowViewController () <CPDFArrowStyleViewDelegate>
 
 @property (nonatomic, strong) UILabel *arrowLabel;
 
@@ -50,20 +50,31 @@
     
     self.trialBtn = [[UIButton alloc] init];
     [self.trialBtn setImage:[UIImage imageNamed:@"CPDFShapeArrowImageEnd" inBundle:[NSBundle bundleForClass:self.class] compatibleWithTraitCollection:nil] forState:UIControlStateNormal];
+    [self.trialBtn addTarget:self action:@selector(buttonItemClicked_trial:) forControlEvents:UIControlEventTouchUpInside];
     self.trialBtn.autoresizingMask = UIViewAutoresizingFlexibleLeftMargin;
     [self.view addSubview:self.trialBtn];
+    
+    if (self.index == CPDFToolbarShapeLine) {
+        self.sampleView.arrowStyleIndex = 0;
+    } else if (self.index == CPDFToolbarShapeArrow) {
+        self.sampleView.arrowStyleIndex = 1;
+    }
+    [self.fillColorSelectView removeFromSuperview];
 }
 
 - (void)viewWillLayoutSubviews {
     [super viewWillLayoutSubviews];
-    self.arrowLabel.frame = CGRectMake(15, 630, 60, 45);
-    self.arrowBtn.frame = CGRectMake(self.view.frame.size.width - 75, 630, 60, 45);
-    self.trialLabel.frame = CGRectMake(15, 675, 60, 45);
-    self.trialBtn.frame = CGRectMake(self.view.frame.size.width - 75, 675, 60, 45);
+    self.opacitySliderView.frame = CGRectMake(10, 280, self.view.frame.size.width - 20, 90);
+    self.thicknessView.frame = CGRectMake(10, 370, self.view.frame.size.width - 20, 90);
+    self.dottedView.frame = CGRectMake(10, 460, self.view.frame.size.width - 20, 90);
+    self.arrowLabel.frame = CGRectMake(15, 550, 60, 45);
+    self.arrowBtn.frame = CGRectMake(self.view.frame.size.width - 75, 550, 60, 45);
+    self.trialLabel.frame = CGRectMake(15, 595, 60, 45);
+    self.trialBtn.frame = CGRectMake(self.view.frame.size.width - 75, 595, 60, 45);
 }
 
 - (void)updatePreferredContentSizeWithTraitCollection:(UITraitCollection *)traitCollection {
-    self.preferredContentSize = CGSizeMake(self.view.bounds.size.width, traitCollection.verticalSizeClass == UIUserInterfaceSizeClassCompact ? 370 : 760);
+    self.preferredContentSize = CGSizeMake(self.view.bounds.size.width, traitCollection.verticalSizeClass == UIUserInterfaceSizeClassCompact ? 370 : 660);
 }
 
 #pragma mark - Action
@@ -71,12 +82,24 @@
 - (void)buttonItemClicked_start:(id)sender {
     CPDFArrowStyleView *arrowStyleView = [[CPDFArrowStyleView alloc] initWirhTitle:@"Arrow Style"];
     arrowStyleView.frame = self.view.frame;
+    arrowStyleView.delegate = self;
     arrowStyleView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
     [self.view addSubview:arrowStyleView];
 }
 
 - (void)buttonItemClicked_trial:(id)sender {
-    
+    CPDFArrowStyleView *arrowStyleView = [[CPDFArrowStyleView alloc] initWirhTitle:@"Trial Style"];
+    arrowStyleView.frame = self.view.frame;
+    arrowStyleView.delegate = self;
+    arrowStyleView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
+    [self.view addSubview:arrowStyleView];
+}
+
+#pragma mark - CPDFArrowStyleViewDelegate
+
+- (void)arrowStyleView:(CPDFArrowStyleView *)arrowStyleView selectIndex:(NSInteger)selectIndex {
+    self.sampleView.arrowStyleIndex = selectIndex;
+    [self.sampleView setNeedsDisplay];
 }
 
 @end

+ 5 - 2
compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFShape/CPDFShapeCircleViewController.m

@@ -43,7 +43,11 @@
     
     self.dottedView = [[CPDFThicknessSliderView alloc] init];
     self.dottedView.delegate = self;
-    self.dottedView.thicknessSlider.value = 1.0;
+    self.dottedView.thicknessSlider.value = 0.0;
+    self.dottedView.thicknessSlider.minimumValue = 0.0;
+    self.dottedView.thicknessSlider.maximumValue = 10.0;
+    self.dottedView.startLabel.text = @"0";
+    self.dottedView.endLabel.text = @"10";
     self.dottedView.autoresizingMask = UIViewAutoresizingFlexibleWidth;
     [self.view addSubview:self.dottedView];
     
@@ -83,7 +87,6 @@
         self.sampleView.thickness = thickness;
         [self.sampleView setNeedsDisplay];
     } else if (thicknessSliderView == self.dottedView) {
-        self.sampleView.thickness = 0;
         self.sampleView.dotted = thickness;
         [self.sampleView setNeedsDisplay];
     }

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

@@ -19,6 +19,8 @@
 #import "CPDFInkViewController.h"
 #import "CPDFShapeCircleViewController.h"
 #import "CPDFShapeArrowViewController.h"
+#import "CPDFFreeTextViewController.h"
+#import "CPDFInkTopToolBar.h"
 #import "CAnnotStyle.h"
 #import "CPDFListView.h"
 #import "CAnnotationManage.h"
@@ -222,7 +224,7 @@
             break;
         case CPDFToolbarFreehand:
         {
-            
+            self.pdfListView.annotationMode = CPDFViewAnnotationModeInk;
         }
             break;
         case CPDFToolbarShapeCircle:
@@ -240,6 +242,11 @@
             self.pdfListView.annotationMode = CPDFViewAnnotationModeArrow;
         }
             break;
+        case CPDFToolbarShapeLine:
+        {
+            self.pdfListView.annotationMode = CPDFViewAnnotationModeLine;
+        }
+            break;
             
         default:
         {
@@ -304,6 +311,16 @@
             presentationController = [[AAPLCustomPresentationController alloc] initWithPresentedViewController:inkVC presentingViewController:self.parentVC];
             inkVC.transitioningDelegate = presentationController;
             [self.parentVC presentViewController:inkVC animated:YES completion:nil];
+            
+            if (@available(iOS 11.0, *)) {
+                CPDFInkTopToolBar *topToolBar = [[CPDFInkTopToolBar alloc] initWithFrame:CGRectMake(50, self.parentVC.view.safeAreaInsets.top, self.parentVC.view.frame.size.width-100, 50)];
+                topToolBar.autoresizingMask = UIViewAutoresizingFlexibleWidth;
+                [self.parentVC.view addSubview:topToolBar];
+            } else {
+                CPDFInkTopToolBar *topToolBar = [[CPDFInkTopToolBar alloc] initWithFrame:CGRectMake(50, 64, self.parentVC.view.frame.size.width-100, 50)];
+                topToolBar.autoresizingMask = UIViewAutoresizingFlexibleWidth;
+                [self.parentVC.view addSubview:topToolBar];
+            }
         }
             break;
         case CPDFToolbarShapeCircle:
@@ -330,6 +347,21 @@
             [self.parentVC presentViewController:arrowVC animated:YES completion:nil];
         }
             break;
+        case CPDFToolbarShapeLine:
+        {
+            CPDFShapeArrowViewController *lineVC = [[CPDFShapeArrowViewController alloc] initWithStyle:annotStytle selectIndex:CPDFToolbarShapeLine title:@"Line"];
+            presentationController = [[AAPLCustomPresentationController alloc] initWithPresentedViewController:lineVC presentingViewController:self.parentVC];
+            lineVC.transitioningDelegate = presentationController;
+            [self.parentVC presentViewController:lineVC animated:YES completion:nil];
+        }
+            break;
+        case CPDFToolbarFreeText:
+        {
+            CPDFFreeTextViewController *freeTextVC = [[CPDFFreeTextViewController alloc] initWithStyle:annotStytle];
+            presentationController = [[AAPLCustomPresentationController alloc] initWithPresentedViewController:freeTextVC presentingViewController:self.parentVC];
+            freeTextVC.transitioningDelegate = presentationController;
+            [self.parentVC presentViewController:freeTextVC animated:YES completion:nil];
+        }
         default:
             break;
     }

+ 8 - 0
compdfkit-tools/compdfkit-tools/Common/Views/PDFProperties/CPDFAnnotationSampleView.h

@@ -37,6 +37,8 @@ NS_ASSUME_NONNULL_BEGIN
 
 @property (nonatomic, assign) CPDFSamplesSelectedIndex selecIndex;
 
+@property (nonatomic, assign) NSInteger arrowStyleIndex;
+
 @property (nonatomic, strong) UIColor *fillColor;
 
 @property (nonatomic, strong) UIColor *fillShapeColor;
@@ -47,6 +49,12 @@ NS_ASSUME_NONNULL_BEGIN
 
 @property (nonatomic, assign) CGFloat dotted;
 
+@property (nonatomic, strong) NSString *fontName;
+
+@property (nonatomic, assign) BOOL isBold;
+
+@property (nonatomic, assign) BOOL isUnderline;
+
 @end
 
 NS_ASSUME_NONNULL_END

+ 114 - 25
compdfkit-tools/compdfkit-tools/Common/Views/PDFProperties/CPDFAnnotationSampleView.m

@@ -126,13 +126,9 @@
         {
             CGContextSetStrokeColorWithColor(context, self.fillColor.CGColor);
             CGContextSetFillColorWithColor(context, self.fillShapeColor.CGColor);
-            if (self.thickness) {
-                CGContextSetLineWidth(context, self.thickness);
-            } else {
-                CGFloat dashLengths[2] = {6, 2};
-                CGContextSetLineDash(context, 0, dashLengths, 2);
-                CGContextSetLineWidth(context, self.dotted);
-            }
+            CGFloat dashLengths[2] = {6, self.dotted};
+            CGContextSetLineDash(context, 0, dashLengths, 2);
+            CGContextSetLineWidth(context, self.thickness);
             CGContextAddArc(context, CGRectGetMaxX(self.bounds)/2, CGRectGetMaxY(self.bounds)/2, 30, 0, 2*PI, 0);
             CGContextDrawPath(context, kCGPathStroke);
             CGContextAddArc(context, CGRectGetMaxX(self.bounds)/2, CGRectGetMaxY(self.bounds)/2, 30, 0, 2*PI, 0);
@@ -143,13 +139,9 @@
         {
             CGContextSetStrokeColorWithColor(context, self.fillColor.CGColor);
             CGContextSetFillColorWithColor(context, self.fillShapeColor.CGColor);
-            if (self.thickness) {
-                CGContextSetLineWidth(context, self.thickness);
-            } else {
-                CGFloat dashLengths[2] = {6, 2};
-                CGContextSetLineDash(context, 0, dashLengths, 2);
-                CGContextSetLineWidth(context, self.dotted);
-            }
+            CGFloat dashLengths[2] = {6, self.dotted};
+            CGContextSetLineDash(context, 0, dashLengths, 2);
+            CGContextSetLineWidth(context, self.thickness);
             CGContextStrokeRect(context, self.centerRect);
             CGContextFillRect(context, self.centerRect);
         }
@@ -157,21 +149,118 @@
         case CPDFSamplesShapeArrow:
         {
             CGContextSetStrokeColorWithColor(context, self.fillColor.CGColor);
-            if (self.thickness) {
-                CGContextSetLineWidth(context, self.thickness);
-            } else {
-                CGFloat dashLengths[2] = {6, 2};
-                CGContextSetLineDash(context, 0, dashLengths, 2);
-                CGContextSetLineWidth(context, self.dotted);
+            CGContextSetFillColorWithColor(context, self.fillColor.CGColor);
+            CGFloat dashLengths[2] = {6, self.dotted};
+            CGContextSetLineDash(context, 0, dashLengths, 2);
+            CGContextSetLineWidth(context, self.thickness);
+            
+            CGPoint start = CGPointMake(CGRectGetMinX(self.arrowRect), CGRectGetMaxY(self.arrowRect));
+            CGPoint end = CGPointMake(CGRectGetMaxX(self.arrowRect), CGRectGetMinY(self.arrowRect));
+            [self drawArrow:context startPoint:start endPoint:end];
+        }
+            break;
+        case CPDFSamplesShapeLine:
+        {
+            CGContextSetStrokeColorWithColor(context, self.fillColor.CGColor);
+            CGContextSetFillColorWithColor(context, self.fillColor.CGColor);
+            CGFloat dashLengths[2] = {6, self.dotted};
+            CGContextSetLineDash(context, 0, dashLengths, 2);
+            CGContextSetLineWidth(context, self.thickness);
+            
+            CGPoint start = CGPointMake(CGRectGetMinX(self.arrowRect), CGRectGetMaxY(self.arrowRect));
+            CGPoint end = CGPointMake(CGRectGetMaxX(self.arrowRect), CGRectGetMinY(self.arrowRect));
+            [self drawArrow:context startPoint:start endPoint:end];
+        }
+            break;
+        case CPDFSamplesFreeText:
+        {
+            NSString *sampleStr = @"AaBbCc";
+            CGContextSetAlpha(context, self.opcity);
+            UIFont *font = [UIFont fontWithName:self.fontName size:self.thickness];
+            NSMutableDictionary *dic = [NSMutableDictionary dictionary];
+            if (self.isBold && !(self.isUnderline)) {
+                font = [UIFont boldSystemFontOfSize:self.thickness];
+            } else if (self.isUnderline && !(self.isBold)) {
+                [dic addEntriesFromDictionary:@{NSFontAttributeName:font, NSUnderlineStyleAttributeName:@1}];
+            } else if (self.isBold && self.isUnderline) {
+                font = [UIFont boldSystemFontOfSize:self.thickness];
+                [dic addEntriesFromDictionary:@{NSFontAttributeName:font, NSUnderlineStyleAttributeName:@1}];
             }
-            CGContextMoveToPoint(context, CGRectGetMinX(self.arrowRect), CGRectGetMaxY(self.arrowRect));
-            CGContextAddLineToPoint(context, CGRectGetMaxX(self.arrowRect), CGRectGetMinY(self.arrowRect));
+            [dic addEntriesFromDictionary:@{NSFontAttributeName:font, NSForegroundColorAttributeName:self.fillColor}];
+            [sampleStr drawInRect:self.arrowRect withAttributes:dic];
+        }
+            break;
+        default:
+            break;
+    }
+}
+
+- (void)drawArrow:(CGContextRef)context startPoint:(CGPoint)start endPoint:(CGPoint)end {
+    switch (self.arrowStyleIndex) {
+        case 0:
+        {
+            CGContextMoveToPoint(context, start.x, start.y);
+            CGContextAddLineToPoint(context, end.x, end.y);
+            CGContextStrokePath(context);
+        }
+            break;
+        case 1:
+        {
+            CGContextMoveToPoint(context, start.x, start.y);
+            CGContextAddLineToPoint(context, end.x, end.y);
+            
+            CGContextMoveToPoint(context, end.x-20, end.y);
+            CGContextAddLineToPoint(context, end.x, end.y);
+            CGContextAddLineToPoint(context, end.x, end.y+20);
+            CGContextStrokePath(context);
+        }
+            break;
+        case 2:
+        {
+            CGContextMoveToPoint(context, start.x, start.y);
+            CGContextAddLineToPoint(context, end.x, end.y);
+            CGContextStrokePath(context);
+            
+            CGContextMoveToPoint(context, end.x-7.5, end.y-7.5);
+            CGContextAddLineToPoint(context, end.x+15, end.y-15);
+            CGContextAddLineToPoint(context, end.x+7.5, end.y+7.5);
+            CGContextFillPath(context);
+        }
+            break;
+        case 3:
+        {
+            CGContextMoveToPoint(context, start.x, start.y);
+            CGContextAddLineToPoint(context, end.x, end.y);
+            CGContextStrokePath(context);
             
-            CGContextMoveToPoint(context, CGRectGetMaxX(self.arrowRect) - 20, CGRectGetMinY(self.arrowRect));
-            CGContextAddLineToPoint(context, CGRectGetMaxX(self.arrowRect), CGRectGetMinY(self.arrowRect));
-            CGContextAddLineToPoint(context, CGRectGetMaxX(self.arrowRect), CGRectGetMinY(self.arrowRect) + 20);
+            CGContextMoveToPoint(context, end.x-7.5, end.y-7.5);
+            CGContextAddLineToPoint(context, end.x+7.5, end.y+7.5);
+            CGContextAddLineToPoint(context, end.x+22.5, end.y-7.5);
+            CGContextAddLineToPoint(context, end.x+7.5, end.y-22.5);
+            CGContextFillPath(context);
+        }
+            break;
+        case 4:
+        {
+            CGContextMoveToPoint(context, start.x, start.y);
+            CGContextAddLineToPoint(context, end.x, end.y);
+            CGContextStrokePath(context);
             
+            CGContextAddArc(context, end.x+7.5, end.y-7.5, 10, 0, 2*3.14159265358979323846, 0);
+            CGContextDrawPath(context, kCGPathStroke);
+        }
+            break;
+        case 5:
+        {
+            CGContextMoveToPoint(context, start.x, start.y);
+            CGContextAddLineToPoint(context, end.x, end.y);
             CGContextStrokePath(context);
+            
+            CGContextMoveToPoint(context, end.x, end.y);
+            CGContextAddLineToPoint(context, end.x+15, end.y);
+            CGContextAddLineToPoint(context, end.x+15, end.y-15);
+            CGContextAddLineToPoint(context, end.x, end.y-15);
+            CGContextFillPath(context);
         }
             break;
         default:

+ 1 - 3
compdfkit-tools/compdfkit-tools/Common/Views/PDFProperties/CPDFArrowStyleCell.m

@@ -19,12 +19,10 @@
 
 - (instancetype)initWithFrame:(CGRect)frame {
     if (self = [super initWithFrame:frame]) {
-        self.contextView = [[CPDFDrawArrowView alloc] initWithSelectIndex:1];
+        self.contextView = [[CPDFDrawArrowView alloc] initWithFrame:self.contentView.bounds];
         self.contextView.layer.borderWidth = 1.0;
         self.contextView.layer.borderColor = [UIColor purpleColor].CGColor;
         self.contextView.backgroundColor = [UIColor whiteColor];
-        self.contextView.frame = self.frame;
-//        [self.contextView ];
         [self.contentView addSubview:self.contextView];
     }
     return self;

+ 10 - 4
compdfkit-tools/compdfkit-tools/Common/Views/PDFProperties/CPDFArrowStyleView.h

@@ -14,13 +14,19 @@
 
 NS_ASSUME_NONNULL_BEGIN
 
-@interface CPDFArrowStyleView : UIView
+@class CPDFArrowStyleView;
+
+@protocol CPDFArrowStyleViewDelegate <NSObject>
+
+@optional
 
-@property (nonatomic, strong) UIButton *backBtn;
+- (void)arrowStyleView:(CPDFArrowStyleView *)arrowStyleView selectIndex:(NSInteger)selectIndex;
 
-@property (nonatomic, strong) UILabel *titleLabel;
+@end
+
+@interface CPDFArrowStyleView : UIView
 
-@property (nonatomic, strong) UICollectionView *collectView;
+@property (nonatomic, weak) id<CPDFArrowStyleViewDelegate> delegate;
 
 - (instancetype)initWirhTitle:(NSString *)title;
 

+ 16 - 19
compdfkit-tools/compdfkit-tools/Common/Views/PDFProperties/CPDFArrowStyleView.m

@@ -16,27 +16,16 @@
 
 @interface CPDFArrowStyleView () <UICollectionViewDelegate,UICollectionViewDataSource>
 
-@property (nonatomic, strong) NSArray *dataArray;
+@property (nonatomic, strong) UIButton *backBtn;
+
+@property (nonatomic, strong) UILabel *titleLabel;
+
+@property (nonatomic, strong) UICollectionView *collectView;
 
 @end
 
 @implementation CPDFArrowStyleView
 
-#pragma mark - Accessors
-
-//- (NSArray *)dataArray {
-//    if (!_dataArray) {
-//        NSMutableArray *dataArray = [NSMutableArray array];
-//        for (NSInteger i = 0; i < 6; i++) {
-//            CPDFDrawArrowView *arrowView = [[CPDFDrawArrowView alloc] initWithSelectIndex:i];
-//            arrowView.backgroundColor = [UIColor redColor];
-//            [dataArray addObject:arrowView];
-//        }
-//        self.dataArray = dataArray;
-//    }
-//    return _dataArray;
-//}
-
 #pragma mark - Initializers
 
 - (instancetype)initWirhTitle:(NSString *)title {
@@ -71,13 +60,12 @@
     [super layoutSubviews];
     self.backBtn.frame = CGRectMake(15, 5, 60, 50);
     self.titleLabel.frame = CGRectMake((self.frame.size.width - 100)/2, 5, 100, 50);
-//    self.collectView.frame = ;
 }
 
 #pragma mark - Action
 
 - (void)buttonItemClicked_back:(id)sender {
-    
+    [self removeFromSuperview];
 }
 
 #pragma mark - UICollectionViewDataSource
@@ -88,8 +76,17 @@
 
 - (__kindof UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath {
     CPDFArrowStyleCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"cell" forIndexPath:indexPath];
-//    cell.contextView = self.dataArray[indexPath.item];
+    cell.contextView.selectIndex = indexPath.item;
+    [cell.contentView setNeedsDisplay];
     return cell;
 }
 
+#pragma mark - UICollectionViewDelegate
+
+- (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath {
+    if (self.delegate && [self.delegate respondsToSelector:@selector(arrowStyleView:selectIndex:)]) {
+        [self.delegate arrowStyleView:self selectIndex:indexPath.item];
+    }
+}
+
 @end

+ 1 - 1
compdfkit-tools/compdfkit-tools/Common/Views/PDFProperties/CPDFDrawArrowView.h

@@ -25,7 +25,7 @@ NS_ASSUME_NONNULL_BEGIN
 
 @interface CPDFDrawArrowView : UIView
 
-- (instancetype)initWithSelectIndex:(CPDFDrawSelectedIndex)selectIndex;
+@property (nonatomic, assign) NSInteger selectIndex;
 
 @end
 

+ 14 - 23
compdfkit-tools/compdfkit-tools/Common/Views/PDFProperties/CPDFDrawArrowView.m

@@ -14,24 +14,15 @@
 
 @interface CPDFDrawArrowView ()
 
-@property (nonatomic, assign) CPDFDrawSelectedIndex selectIndex;
-
 @end
 
 @implementation CPDFDrawArrowView
 
-- (instancetype)initWithSelectIndex:(CPDFDrawSelectedIndex)selectIndex {
-    if (self = [super init]) {
-        self.selectIndex = selectIndex;
-    }
-    return self;
-}
-
 - (void)drawRect:(CGRect)rect {
     [super drawRect:rect];
     CGContextRef context = UIGraphicsGetCurrentContext();
-    CGPoint start = CGPointMake(CGRectGetMinX(rect), CGRectGetMidY(rect));
-    CGPoint end = CGPointMake(CGRectGetMaxX(rect), CGRectGetMidY(rect));
+    CGPoint start = CGPointMake(CGRectGetMinX(rect)+20, CGRectGetMidY(rect));
+    CGPoint end = CGPointMake(CGRectGetMaxX(rect)-20, CGRectGetMidY(rect));
     [self drawArrow:context startPoint:start endPoint:end];
 }
 
@@ -55,7 +46,7 @@
             
             CGContextMoveToPoint(context, end.x-5, end.y-5);
             CGContextAddLineToPoint(context, end.x, end.y);
-            CGContextAddLineToPoint(context, end.x+5, end.y+5);
+            CGContextAddLineToPoint(context, end.x-5, end.y+5);
             CGContextStrokePath(context);
         }
             break;
@@ -65,9 +56,9 @@
             CGContextAddLineToPoint(context, end.x, end.y);
             CGContextStrokePath(context);
             
-            CGContextMoveToPoint(context, end.x-5, end.y-5);
-            CGContextAddLineToPoint(context, end.x, end.y);
-            CGContextAddLineToPoint(context, end.x+5, end.y+5);
+            CGContextMoveToPoint(context, end.x, end.y-5);
+            CGContextAddLineToPoint(context, end.x+5, end.y);
+            CGContextAddLineToPoint(context, end.x, end.y+5);
             CGContextFillPath(context);
         }
             break;
@@ -77,10 +68,10 @@
             CGContextAddLineToPoint(context, end.x, end.y);
             CGContextStrokePath(context);
             
-            CGContextMoveToPoint(context, end.x-10, end.y);
-            CGContextAddLineToPoint(context, end.x - 5, end.y - 5);
-            CGContextAddLineToPoint(context, end.x + 5, end.y + 5);
-            CGContextAddLineToPoint(context, end.x, end.y+10);
+            CGContextMoveToPoint(context, end.x, end.y-5);
+            CGContextAddLineToPoint(context, end.x, end.y+5);
+            CGContextAddLineToPoint(context, end.x+10, end.y+5);
+            CGContextAddLineToPoint(context, end.x+10, end.y-5);
             CGContextFillPath(context);
         }
             break;
@@ -90,7 +81,7 @@
             CGContextAddLineToPoint(context, end.x, end.y);
             CGContextStrokePath(context);
             
-            CGContextAddArc(context, end.x, end.y, 10, 0, 2*3.14159265358979323846, 0);
+            CGContextAddArc(context, end.x+2.5, end.y, 5, 0, 2*3.14159265358979323846, 0);
             CGContextDrawPath(context, kCGPathStroke);
         }
             break;
@@ -100,10 +91,10 @@
             CGContextAddLineToPoint(context, end.x, end.y);
             CGContextStrokePath(context);
             
-            CGContextMoveToPoint(context, end.x-5, end.y-5);
-            CGContextAddLineToPoint(context, end.x, end.y);
+            CGContextMoveToPoint(context, end.x, end.y);
             CGContextAddLineToPoint(context, end.x+5, end.y+5);
-            CGContextAddLineToPoint(context, end.x-10, end.y+10);
+            CGContextAddLineToPoint(context, end.x+10, end.y);
+            CGContextAddLineToPoint(context, end.x+5, end.y-5);
             CGContextFillPath(context);
         }
             break;

+ 33 - 0
compdfkit-tools/compdfkit-tools/Common/Views/PDFProperties/CPDFFontStyleTableView.h

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

+ 100 - 0
compdfkit-tools/compdfkit-tools/Common/Views/PDFProperties/CPDFFontStyleTableView.m

@@ -0,0 +1,100 @@
+//
+//  CFontStyleTableView.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 "CPDFFontStyleTableView.h"
+
+@interface CPDFFontStyleTableView () <UITableViewDelegate, UITableViewDataSource>
+
+@property (nonatomic, strong) NSArray *dataArray;
+
+@property (nonatomic, strong) UIButton *backBtn;
+
+@property (nonatomic, strong) UILabel *titleLabel;
+
+@property (nonatomic, strong) UITableView *tableView;
+
+@end
+
+@implementation CPDFFontStyleTableView
+
+#pragma mark - Initializers
+
+- (NSArray *)dataArray {
+    if (!_dataArray) {
+        NSMutableArray *dataArray = [NSMutableArray array];
+        NSArray *fontNameArray = [[NSArray alloc] initWithObjects:@"Helvetica",@"Arial",@"Arial Rounded MT Bold",@"Courier",nil];
+        
+        for (int i = 0; i < fontNameArray.count; i++) {
+            [dataArray addObject:fontNameArray[i]];
+        }
+        _dataArray = (NSArray *)dataArray;
+    }
+    return _dataArray;
+}
+
+#pragma mark - Initializers
+
+- (instancetype)initWithFrame:(CGRect)frame {
+    if (self = [super initWithFrame:frame]) {
+        self.titleLabel = [[UILabel alloc] initWithFrame:CGRectMake((self.frame.size.width - 120)/2, 0, 120, (self.bounds.size.height - 40)/6)];
+        self.titleLabel.text = NSLocalizedString(@"Font Name", nil);
+        self.titleLabel.autoresizingMask  = UIViewAutoresizingFlexibleHeight;
+        [self addSubview:self.titleLabel];
+        
+        self.backBtn = [[UIButton alloc] initWithFrame:CGRectMake(10, 0, 40, (self.bounds.size.height - 40)/6)];
+        self.backBtn.autoresizingMask = UIViewAutoresizingFlexibleHeight;
+        [self.backBtn setImage:[UIImage imageNamed:@"CPDFAnnotationBarImageUndo" inBundle:[NSBundle bundleForClass:self.class] compatibleWithTraitCollection:nil] forState:UIControlStateNormal];
+        [self.backBtn addTarget:self action:@selector(buttonItemClicked_back:) forControlEvents:UIControlEventTouchUpInside];
+        [self addSubview:self.backBtn];
+        
+        self.tableView = [[UITableView alloc] initWithFrame:CGRectMake(0, (self.bounds.size.height - 40)/6, self.bounds.size.width, self.bounds.size.height) style:UITableViewStylePlain];
+        self.tableView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
+        self.tableView.delegate = self;
+        self.tableView.dataSource = self;
+        [self addSubview:self.tableView];
+        
+        self.backgroundColor = [UIColor whiteColor];
+    }
+    return self;;
+}
+
+#pragma mark - Action
+
+- (void)buttonItemClicked_back:(id)sender {
+    [self removeFromSuperview];
+}
+
+#pragma mark - UITableViewDataSource
+
+- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
+    return self.dataArray.count;
+}
+
+- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
+    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"fontName"];
+    if (cell == nil) {
+        cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"fontName"];
+    }
+    
+    cell.textLabel.text = self.dataArray[indexPath.row];
+    return cell;
+}
+
+#pragma mark - UITableViewDelegate
+
+- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
+    if (self.delegate && [self.delegate respondsToSelector:@selector(fontStyleTableView:fontName:)]) {
+        [self.delegate fontStyleTableView:self fontName:self.dataArray[indexPath.row]];
+    }
+}
+
+@end